{"id":2652,"date":"2019-07-17T10:56:49","date_gmt":"2019-07-17T10:56:49","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=2652"},"modified":"2024-03-26T07:45:05","modified_gmt":"2024-03-26T07:45:05","slug":"file-handling-in-python-tutorial","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/","title":{"rendered":"File Handling in Python"},"content":{"rendered":"<h1 style=\"text-align: center;\"><strong>File Handling in Python Tutorial<\/strong><\/h1>\n<p>&nbsp;<\/p>\n<p><strong>File Handling in Python Tutorial<\/strong>, Welcome to the world of Python File Handling\u00a0 Tutorial. In this tutorial, we will learn what is file handling in python and how Python handles files. Here, You will also learn Python File Handling Operations, how to open a file in Python which is helpful for any Python developers. Are you looking for the information of python file handling tutorial or Or the one who is very keen to explore the File Handling in <a title=\"online python course with certificate\" href=\"https:\/\/prwatech.in\/python-training-institute-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python<\/a>\u00a0with Examples that are available or Are you dreaming to become to certified Pro <a title=\"online course to learn python\" href=\"https:\/\/prwatech.in\/python-training-institute-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python Developer<\/a>, then stop just dreaming, get your <a title=\"online python course with certificate\" href=\"https:\/\/prwatech.in\/python-training-institute-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python certification course<\/a> from India\u2019s Leading <a title=\"python training course online\" href=\"https:\/\/prwatech.in\/python-training-institute-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python training institute<\/a>.<\/p>\n<p>Python File Handling operations is one of the essential concepts for all programmers, which is used either to write a file or read data from the file. Mostly, all the values or data are stored in Variables at run time and when program execution is completed, the data will get lost. Hence, all Programmers will save the data permanently using files. Do you want to know about how Python handles files and Python File Handling Operations, then just follow the below-mentioned File Handling in Python Tutorial for Beginners from <a title=\"big data certification online\" href=\"https:\/\/prwatech.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Prwatech<\/a> and take advanced <a title=\"online python training course\" href=\"https:\/\/prwatech.in\/python-training-institute-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python training<\/a> like a Pro from today itself under 10+ years of hands-on experienced Professionals.<\/p>\n<h2>What is File Handling in Python?<\/h2>\n<p>In programming whatever operations we perform over variables and functions are temporary in nature. We cannot store it permanently use it. So, in order to have permanent storage of code we store it as a file. For handling these files we use <a title=\"online course on python\" href=\"https:\/\/prwatech.in\/python-training-institute-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">File Handling techniques in Python<\/a>. Python, like other languages, allows users to handle files i.e., to read and write files with many other file handling options.<\/p>\n<h2>How Python Handle Files?<\/h2>\n<p>Python file handling is essential for programmers as it has to deal with different operations like reading data from file or writing or adding data to file. Improving a single file operation can help you produce a high-performing application or a robust solution for automated software testing.<\/p>\n<p><strong>Processing of file is done in the following format:<\/strong><\/p>\n<p>The file is opened returning filehandle.<\/p>\n<p>file used to perform different actions like reading data, writing data, etc.<\/p>\n<p>The file is closed.<\/p>\n<h2>Python File Handling Operations<\/h2>\n<h3><strong>Use of open():<\/strong><\/h3>\n<p>file object = open(file_name [, access_mode][, buffering])<\/p>\n<p><strong>The parameters in syntax have the following significance:<\/strong><\/p>\n<p><strong>&lt;access_mode&gt; &#8211;\u00a0<\/strong>This is an integer field that represents the opening mode of file e.g., read, write, rename, delete, append, etc. It\u2019s an elective parameter. It is, by default, set to read-only \u201cr\u201d mode. So we get data in text format due to reading mode. Different modes are explained below with their notations and syntax. It\u2019s also desirable for accessing the non-text files like an image or the Exe files.<\/p>\n<p><strong>&lt;buffering&gt;-<\/strong> For this field default value is 0.It means buffering will not take place. The line buffering will take place if the value is 1 while accessing the file. If it\u2019s greater than 1, then the buffering takes place according to the buffer size. If the value is less than 1 i.e. negative, then the default behavior is taken into account.<\/p>\n<p><strong>&lt;file_name&gt;-<\/strong> This field is a string indicating the name of the file expected to be accessed.<\/p>\n<p>There are different modes while opening a file.<\/p>\n<h3><strong>Modes for opening a file<\/strong><\/h3>\n<p>Let\u2019s see the different modes of operation for a file.<\/p>\n<h3><strong>Read mode<\/strong><\/h3>\n<p>Notation: \u2018r\u2019<\/p>\n<p>This opens the file in reading mode.<\/p>\n<p><strong>It\u2019s syntax is:<\/strong><\/p>\n<p>file = open(\u201ctestfile_name.txt\u201d, \u201cr\u201d)<\/p>\n<h3><strong>Append Mode<\/strong><\/h3>\n<p>This opens a\u00a0 file for appending mean adding any data in it.<\/p>\n<p><strong>It\u2019s syntax is:<\/strong><\/p>\n<p>file= open(\u201ctestfile_name.txt\u201d, \u201ca\u201d)<\/p>\n<h3><strong>Write Mode<\/strong><\/h3>\n<p>This opens the file in write mode.<\/p>\n<p><strong>It\u2019s syntax is:<\/strong><\/p>\n<p>file= open(\u201ctestfile_name.txt\u201d, \u2018w\u201d)<\/p>\n<h3><strong>Create Mode<\/strong><\/h3>\n<p>This opens file in create mode means it creates a file with a specific name<\/p>\n<p><strong>It\u2019s syntax is:<\/strong><\/p>\n<p>file= open(\u201ctestfile_name.txt\u201d, \u201cx\u201d)<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h3><strong>Text Mode<\/strong><\/h3>\n<p>This opens the file in text mode. This means it creates a text file.<\/p>\n<p><strong>It\u2019s syntax is:<\/strong><\/p>\n<p>file= open(\u201ctestfile_name.txt\u201d, \u2018rt\u201d)<\/p>\n<h3><strong>Binary Mode<\/strong><\/h3>\n<p>This opens the file in binary mode. This means it creates a binary file of the mentioned file.<\/p>\n<p><strong>It\u2019s syntax is:<\/strong><\/p>\n<p>file= open(\u201ctestfile_name.txt\u201d, \u201crb\u201d)<\/p>\n<h3><strong>Read and Write Mode<\/strong><\/h3>\n<p>This will allow read and write operations.<\/p>\n<p><strong>It\u2019s syntax is:<\/strong><\/p>\n<p>file= open(\u201ctestfile_name.txt\u201d, \u201cr+\u201d)<\/p>\n<h3>Read and write in binary mode<\/h3>\n<p>This will allow read and write operations in binary format.<\/p>\n<p><strong>It\u2019s syntax is:<\/strong><\/p>\n<p>file= open(\u201ctestfile_name.txt\u201d, \u201crb+\u201d)<\/p>\n<p><strong>In short, we can remind the tabular form as follows:<\/strong><\/p>\n<table width=\"718\">\n<tbody>\n<tr>\n<td width=\"132\"><strong>Name<\/strong><\/td>\n<td width=\"94\"><strong>Indication<\/strong><\/td>\n<td width=\"246\"><strong>Description<\/strong><\/td>\n<td width=\"246\"><strong>Syntax<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"132\">Read<\/td>\n<td width=\"94\">\u201cr\u201d<\/td>\n<td width=\"246\">Opens a file in reading mode<\/td>\n<td width=\"246\">f=open(\u201ctestfile_name.txt\u201d, \u201cr\u201d)<\/td>\n<\/tr>\n<tr>\n<td width=\"132\">Append<\/td>\n<td width=\"94\">\u201ca\u201d<\/td>\n<td width=\"246\">Opens a file for appending<\/td>\n<td width=\"246\">f=open(\u201ctestfile_name.txt\u201d, \u201ca\u201d)<\/td>\n<\/tr>\n<tr>\n<td width=\"132\">Write<\/td>\n<td width=\"94\">\u201cw\u201d<\/td>\n<td width=\"246\">Opens a file in write mode<\/td>\n<td width=\"246\">f=open(\u201ctestfile_name.txt\u201d, \u201cw\u201d)<\/td>\n<\/tr>\n<tr>\n<td width=\"132\">Create<\/td>\n<td width=\"94\">\u201cx\u201d<\/td>\n<td width=\"246\">Creates a file with a specified name<\/td>\n<td width=\"246\">f=open(\u201ctestfile_name.txt\u201d, \u201cx\u201d)<\/td>\n<\/tr>\n<tr>\n<td width=\"132\">Text<\/td>\n<td width=\"94\">\u201ct\u201d<\/td>\n<td width=\"246\">Creates a text file<\/td>\n<td width=\"246\">f=open(\u201ctestfile_name.txt\u201d, \u201crt\u201d)<\/td>\n<\/tr>\n<tr>\n<td width=\"132\">Binary<\/td>\n<td width=\"94\">\u201cb\u201d<\/td>\n<td width=\"246\">Creates a binary file<\/td>\n<td width=\"246\">f=open(\u201ctestfile_name.txt\u201d, \u201crb\u201d)<\/td>\n<\/tr>\n<tr>\n<td width=\"132\">Read andWrite<\/td>\n<td width=\"94\">\u201cr+\u201d<\/td>\n<td width=\"246\">Allows file for reading and writing only<\/td>\n<td width=\"246\">f=open(\u201ctestfile_name.txt\u201d, \u201cr+\u201d)<\/td>\n<\/tr>\n<tr>\n<td width=\"132\">Read and write in binary<\/td>\n<td width=\"94\">\u201crb+\u201d<\/td>\n<td width=\"246\">Allows reading and writing files in binary format<\/td>\n<td width=\"246\">f=open(\u201ctestfile_name.txt\u201d, \u201crb+\u201d)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><strong>Use of reading ()<\/strong><\/h3>\n<p>read(): It is used to read the file which is already open.<\/p>\n<p><strong>Syntax: <\/strong><\/p>\n<p>filename.read()<\/p>\n<p><strong>Ex)<\/strong> f = open(\u201ca.txt\u201d, \u201cr\u201d)<\/p>\n<p>print(f.read())<\/p>\n<p>We can also extract first \u2018n\u2019 number of characters from file.<\/p>\n<p>print(f.read(4))<\/p>\n<p>It will give first 4 characters in file.<\/p>\n<h3><strong>Use of readlines ()<\/strong><\/h3>\n<p>This command is used to read one line.<\/p>\n<p><strong>Syntax: <\/strong><\/p>\n<p>filename.read()<\/p>\n<p><strong>Ex)<\/strong> f = open(\u201ca.txt\u201d, \u201cr\u201d)<\/p>\n<p>print(f.readline())<\/p>\n<h3><strong>Use of close()<\/strong><\/h3>\n<p>It is simply used to a closed line<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<p>filename.close()<\/p>\n<p><strong>Ex)<\/strong> f = open (\u201ca.txt\u201d, \u201cr\u201d)<\/p>\n<p>print(f.read())<\/p>\n<p>f.close()<\/p>\n<h3><strong>Use of write() mode for file creation<\/strong><\/h3>\n<p>It is command which allows to write in particular file.<\/p>\n<p>f=open(&#8216;test.txt&#8217;,&#8217;w&#8217;)<\/p>\n<p>f.write(&#8220;Writing in this file&#8221;)<\/p>\n<p>f.close()<\/p>\n<h3><strong>Use of append() mode<\/strong><\/h3>\n<p>It will append or add the contents in existing file.<\/p>\n<p>f=open(&#8216;test.txt&#8217;,&#8217;a&#8217;)<\/p>\n<p>f.write(&#8220;Adding this line to file&#8221;)<\/p>\n<p>f.close()<\/p>\n<h3><strong>Renaming File<\/strong><\/h3>\n<p>We can change file name with rename() function as follows:<\/p>\n<p>importos<\/p>\n<p>os.rename(file_current_name, file_new_name)It will rename the file with new assigned name.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<p>import os<\/p>\n<p>os.rename(\u201ctest_file.txt\u201d, \u201cpython_file.txt\u201d)<\/p>\n<p>We hope you understand File Handling in Python Tutorial concepts. Get success in your career as a <a title=\"online python programming course\" href=\"https:\/\/prwatech.in\/python-training-institute-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python developer<\/a> by being a part of the <a title=\"online python course for beginners\" href=\"https:\/\/prwatech.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Prwatech<\/a>, India&#8217;s leading <a title=\"online course to learn python\" href=\"https:\/\/prwatech.in\/python-training-institute-in-bangalore\/\" target=\"_blank\" rel=\"noopener noreferrer\">Python training institute in Bangalore<\/a>.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/IdGoSKoO9Bk\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>File Handling in Python Tutorial &nbsp; File Handling in Python Tutorial, Welcome to the world of Python File Handling\u00a0 Tutorial. In this tutorial, we will learn what is file handling in python and how Python handles files. Here, You will also learn Python File Handling Operations, how to open a file in Python which is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3427,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,1672],"tags":[400,77,540,537,401,545,547],"class_list":["post-2652","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-python-file-handling","tag-file-handling-in-python-tutorial","tag-file-handling-in-python-tutorial-with-example","tag-online-course-to-learn-python","tag-online-training-on-python","tag-python-file-handling-operations","tag-python-training-course-online","tag-python-training-online"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>File Handling in Python Tutorial | Python File Handling Operations<\/title>\n<meta name=\"description\" content=\"Here is detailed information about File Handling in Python tutorial &amp; Learn Python file handling operations,How Python Handle Files,Modes for opening file.\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"File Handling in Python Tutorial | Python File Handling Operations\" \/>\n<meta property=\"og:description\" content=\"Here is detailed information about File Handling in Python tutorial &amp; Learn Python file handling operations,How Python Handle Files,Modes for opening file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-17T10:56:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-26T07:45:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/07\/File-Handling-in-Python.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/\",\"url\":\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/\",\"name\":\"File Handling in Python Tutorial | Python File Handling Operations\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/07\/File-Handling-in-Python.jpg\",\"datePublished\":\"2019-07-17T10:56:49+00:00\",\"dateModified\":\"2024-03-26T07:45:05+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Here is detailed information about File Handling in Python tutorial & Learn Python file handling operations,How Python Handle Files,Modes for opening file.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/07\/File-Handling-in-Python.jpg\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/07\/File-Handling-in-Python.jpg\",\"width\":960,\"height\":550,\"caption\":\"File Handling in Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"File Handling in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"File Handling in Python Tutorial | Python File Handling Operations","description":"Here is detailed information about File Handling in Python tutorial & Learn Python file handling operations,How Python Handle Files,Modes for opening file.","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"File Handling in Python Tutorial | Python File Handling Operations","og_description":"Here is detailed information about File Handling in Python tutorial & Learn Python file handling operations,How Python Handle Files,Modes for opening file.","og_url":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2019-07-17T10:56:49+00:00","article_modified_time":"2024-03-26T07:45:05+00:00","og_image":[{"width":960,"height":550,"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/07\/File-Handling-in-Python.jpg","type":"image\/jpeg"}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/","url":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/","name":"File Handling in Python Tutorial | Python File Handling Operations","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/07\/File-Handling-in-Python.jpg","datePublished":"2019-07-17T10:56:49+00:00","dateModified":"2024-03-26T07:45:05+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Here is detailed information about File Handling in Python tutorial & Learn Python file handling operations,How Python Handle Files,Modes for opening file.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/07\/File-Handling-in-Python.jpg","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/07\/File-Handling-in-Python.jpg","width":960,"height":550,"caption":"File Handling in Python"},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/python\/python-file-handling\/file-handling-in-python-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"File Handling in Python"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=2652"}],"version-history":[{"count":17,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2652\/revisions"}],"predecessor-version":[{"id":11108,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2652\/revisions\/11108"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media\/3427"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=2652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=2652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=2652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}