{"id":796,"date":"2021-05-04T21:41:09","date_gmt":"2021-05-04T16:11:09","guid":{"rendered":"https:\/\/cbsepython.in\/?p=796"},"modified":"2024-04-17T22:09:37","modified_gmt":"2024-04-17T16:39:37","slug":"data-file-handling-in-python","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/data-file-handling-in-python\/","title":{"rendered":"Data File Handling in Python Class 12 Notes"},"content":{"rendered":"<h2><span style=\"color: #000000;\">Python File Handling Notes for class 12\u00a0<\/span><\/h2>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #000000;\">Data File Handling in Python<\/span><\/h3>\n<p><span style=\"color: #000000;\">Data maintained inside the files is termed as persistent data. It means it is permanent in nature.<\/span><br \/>\n<span style=\"color: #000000;\">Python allow us to read data from and save data to external text files permanently on secondary storage media.<\/span><\/p>\n<p><span style=\"color: #000000;\">Before we start working with a file, first we need to open it. After performing the desirable operation, it needs to be closed so that resources that are tied in the file are freed.<\/span><\/p>\n<p><span style=\"color: #000000;\">Data File handling takes place in the following order.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>1- Opening a file.<\/strong><\/span><br \/>\n<span style=\"color: #000000;\"><strong>2- Performing operations (read, write) or processing data.<\/strong><\/span><br \/>\n<span style=\"color: #000000;\"><strong>3- Closing the file.<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #000000;\">We can process file in several ways, such as:<\/span><\/h3>\n<p>&nbsp;<\/p>\n<p><em><span style=\"color: #000000;\">-&gt; Creating a file<\/span><\/em><\/p>\n<p><em><span style=\"color: #000000;\">-&gt;Traversing a file for displaying data on screen<\/span><\/em><\/p>\n<p><em><span style=\"color: #000000;\">-&gt;Appending data in a file<\/span><\/em><\/p>\n<p><em><span style=\"color: #000000;\">-&gt;Inserting data in a file<\/span><\/em><\/p>\n<p><em><span style=\"color: #000000;\">-&gt;Deleting data in from a file<\/span><\/em><\/p>\n<p><em><span style=\"color: #000000;\">-&gt;Creating a copy of a file<\/span><\/em><\/p>\n<p><em><span style=\"color: #000000;\">-&gt;Updating data in a file<\/span><\/em><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #000000;\">Types of File in Python:<\/span><\/h3>\n<p><span style=\"color: #000000;\">Before we discuss file operation we should be aware of the file types. Python allows us to create and manage two types of data files.<\/span><\/p>\n<h3><span style=\"color: #000000;\">1- <a href=\"https:\/\/cbsepython.in\/operations-on-text-file\/\">Text file<\/a><\/span><\/h3>\n<h3><span style=\"color: #000000;\">2- <a href=\"https:\/\/cbsepython.in\/binary-file-handling-in-python-class-12-notes\/\">Binary file<\/a><\/span><\/h3>\n<h2 style=\"text-align: center;\"><span style=\"color: #000000;\">File Modes<\/span><\/h2>\n<table style=\"width: 97.3262%; height: 1197px;\">\n<tbody>\n<tr style=\"height: 45px;\">\n<td style=\"height: 45px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>Mode<\/strong><\/span><\/td>\n<td style=\"height: 45px; width: 106.173%;\" width=\"511\">\n<p style=\"text-align: center;\"><span style=\"color: #000000; font-size: 12pt;\"><strong>Description<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"height: 104px;\">\n<td style=\"height: 104px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>r<\/strong><\/span><\/td>\n<td style=\"height: 104px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode. If the specified file does not exist, it will generate FileNotFoundError.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 80px;\">\n<td style=\"height: 80px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>rb<\/strong><\/span><\/td>\n<td style=\"height: 80px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the default mode.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 80px;\">\n<td style=\"height: 80px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>r+<\/strong><\/span><\/td>\n<td style=\"height: 80px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for both reading and writing. (+) The file pointer will be at the beginning of the file.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 80px;\">\n<td style=\"height: 80px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>rb+<\/strong><\/span><\/td>\n<td style=\"height: 80px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for both reading and writing in binary format. The file pointer will be at the beginning of the file.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 80px;\">\n<td style=\"height: 80px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>w<\/strong><\/span><\/td>\n<td style=\"height: 80px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for writing only. Overwrites the file if the file exists. If the file does not exist, it creates a new file for writing.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 80px;\">\n<td style=\"height: 80px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>wb<\/strong><\/span><\/td>\n<td style=\"height: 80px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for writing only in binary format. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 104px;\">\n<td style=\"height: 104px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>w+<\/strong><\/span><\/td>\n<td style=\"height: 104px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for both writing and reading. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 104px;\">\n<td style=\"height: 104px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>wb+<\/strong><\/span><\/td>\n<td style=\"height: 104px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for both writing and reading in binary format. Overwrites the existing file if the file exists. If the file does not exist, creates new file for reading and writing.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 104px;\">\n<td style=\"height: 104px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>a<\/strong><\/span><\/td>\n<td style=\"height: 104px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 104px;\">\n<td style=\"height: 104px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>ab<\/strong><\/span><\/td>\n<td style=\"height: 104px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for appending in binary format. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 104px;\">\n<td style=\"height: 104px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>a+<\/strong><\/span><\/td>\n<td style=\"height: 104px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for both appending and reading. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.<\/span><\/td>\n<\/tr>\n<tr style=\"height: 128px;\">\n<td style=\"height: 128px; width: 16.358%; text-align: center;\" width=\"127\"><span style=\"color: #000000; font-size: 12pt;\"><strong>ab+<\/strong><\/span><\/td>\n<td style=\"height: 128px; width: 106.173%;\" width=\"511\"><span style=\"color: #000000; font-size: 12pt;\">Opens a file for both appending and reading in binary format. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>Python Data File Handling<\/h2>\n<h3>operations on text file<\/h3>\n<p>A text file consists of a sequence of lines. A line is a sequence of characters, stored on permanent storage. In a text file, each line is terminated by a special character, known as End Of Line (EOL). Text file can be created using any text editor. Ex. Myfile.txt.<\/p>\n<p>&nbsp;<\/p>\n<h3>Opening a text file: Open ()<\/h3>\n<p>When we want to read or write a file, we must have to open is first. Open () function takes the name of a file as the first argument. The second argument indicates the mode of accessing the file.<\/p>\n<p>Syntax:<\/p>\n<p>&lt;file variable&gt;=open(file name, access mode)<\/p>\n<p>Modes for opening a file:<\/p>\n<p>read(r) : to read the file<\/p>\n<p>write(w): to write the file<\/p>\n<p>append(a):\u00a0 to write at the end of file<\/p>\n<p>&nbsp;<\/p>\n<p>Ex:<\/p>\n<p>&gt;&gt;&gt; f=open(&#8216;myfile.txt&#8217;)<\/p>\n<p>&gt;&gt;&gt; print(f)<\/p>\n<p>&nbsp;<\/p>\n<p>Output:<\/p>\n<pre>&lt;_io.TextIOWrapper name='myfile.txt' mode='r' encoding='cp1252'&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><span style=\"text-decoration: underline; color: #000000;\"><strong>Python File Handling notes for CBSE class 12 Computer Science<\/strong><\/span><\/p>\n<h3>Closing file: close()<\/h3>\n<p>Syntax:\u00a0 file_Object.close()<\/p>\n<p>Example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">f=open('myfile.txt')\r\nprint(\"The file which is to be open using the given command is:\",f.name)\r\nf.close()\r\n<\/pre>\n<p>Output:<\/p>\n<pre>The file which is to be open using the given command is: myfile.txt<\/pre>\n<p>&nbsp;<\/p>\n<h3>Properties of File Object:<\/h3>\n<p>&nbsp;<\/p>\n<p><strong>name:<\/strong> shows the file name of opened file<\/p>\n<p><strong>mode:<\/strong> shows Mode in which the file gets opened<\/p>\n<p><strong>readable:<\/strong> returns Boolean value, which indicates whether the file is readable or not<\/p>\n<p><strong>closed:<\/strong> returns Boolean value, which indicates whether the file is closed or not<\/p>\n<p>&nbsp;<\/p>\n<p>Example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">f=open('myfile.txt', 'w')\r\nprint(\"Name of File:\",f.name)\r\nprint(\"Mode of File:\",f.mode)\r\nprint(\"File readable :\",f.readable())\r\nprint(\"File closed:\",f.closed)\r\nf.close()\r\nprint(\"File closed:\",f.closed, f.name)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Output:<\/p>\n<pre>Name of File: myfile.txt\r\nMode of File: w\r\nFile readable : False\r\nFile closed: False\r\nFile closed: True myfile.txt<\/pre>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><span style=\"text-decoration: underline; color: #000000;\"><strong>Python File Handling notes for CBSE class 12 Computer Science<\/strong><\/span><\/p>\n<h3>Reading form a file:<\/h3>\n<p>We can read character data from text file by using the following read methods:<\/p>\n<p>&nbsp;<\/p>\n<p>read(): To read the entire data from the file; starts reading from the cursor up to the end of the file.<\/p>\n<p>Synatx:<\/p>\n<p>file_Object.read()<\/p>\n<p>Example:<\/p>\n<p>The text file named myfile.txt is already stored in my local disk with the data shown in image.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-937 size-full\" src=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/06\/Text_File.jpg\" alt=\"CBSE file handling\" width=\"407\" height=\"156\" title=\"\" srcset=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/06\/Text_File.jpg 407w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/06\/Text_File-300x115.jpg 300w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/06\/Text_File-400x153.jpg 400w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">f=open('myfile.txt', 'r')\r\ndata=f.read()\r\nprint(data)\r\nf.close()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Output:<\/p>\n<pre>== RESTART: C:\/Users\/ATC\/AppData\/Local\/Programs\/Python\/Python38-32\/filehandling.py =\r\nHello,\r\nWelcome to the CBSE class 12 students\r\nHaving computer science with python\r\nYou are learning Python file handling\r\n&gt;&gt;&gt;\r\n\r\n<\/pre>\n<p>read(n): To read &#8216;n&#8217; characters from the file, starting from the cursor.<\/p>\n<p>Example: Here we will read only first 21 characters from the file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">f=open('myfile.txt', 'r')\r\ndata=f.read(21)\r\nprint(data)\r\nf.close()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Output:<\/p>\n<pre>Hello,\r\nWelcome to the<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>readline():<\/strong> To read only one line from the file; starts reading from the cursor up to, and including, the end of line character.<\/p>\n<p><strong>readlines():<\/strong> To read all lines from the file into a list; starts reading from the cursor up to the end of the file and returns a list of lines.<\/p>\n<h3><\/h3>\n<h3><span style=\"color: #000000;\">Writing to the text file:\u00a0<\/span><\/h3>\n<p><span style=\"color: #000000;\">There are two methods in Python to write data to the text file.\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>1. write( ):<\/strong> This method takes a string as a parameter and writes it in the file. As we discussed about the file mode earlier, we use &#8216;w&#8217; access mode to write date to the text file.<\/span><\/p>\n<p><span style=\"color: #000000;\">Syntax: fileObject.write (string)<\/span><\/p>\n<p>Example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">f=open('myfile.txt', 'w')\r\nf.write(\"these are file handing notes for class 12\")\r\nprint(\"Your data is written to the text file successfully\")\r\nf.close()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Output:<\/span><\/p>\n<pre>= RESTART: C:\/Users\/lenovo\/AppData\/Local\/Programs\/Python\/Python311\/file_handling.py\r\nYour data is written to the text file successfully<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>2. writelines ( ):<\/strong> This method is used whenever we have to write a sequence of data types or string.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Syntax: fileObject.write (sequence)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">f=open('myfile.txt', 'w')\r\nlist=[\"Class 12\",\"File Handling Notes\\n\", \"You are learning\\n\", \"Writing to the text file\"]\r\nf.writelines(list)\r\nprint(\"Your data is written to the text file successfully\")\r\nf.close()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><span style=\"text-decoration: underline; color: #000000;\"><strong>Python File Handling notes for CBSE class 12 Computer Science<\/strong><\/span><\/p>\n<h3><span style=\"color: #000000;\">Appending to the text file:\u00a0<\/span><\/h3>\n<p><span style=\"color: #000000;\">When &#8216;w&#8217; access mode is used in file handing it overwrites or replace the previous written data. <\/span><span style=\"color: #000000;\">As you already know about append which means &#8216;to add data at end of file&#8217;, we use access mode &#8216;a&#8217; to insert data to the text file at the end. <\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">f=open('myfile.txt', 'a')\r\nf.write(\"Class 12\\n\")\r\nf.write(\"File Handling Notes\\n\")\r\nf.write(\"You are learning\\n\")\r\nf.write(\"Writing \/ appending to the text file\")\r\nprint(\"Your data is written to the text file successfully\")\r\nf.close()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>You just check if the data is successfully written to the file or not by reading the file again.\u00a0Now lets check.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">f=open(\"myfile.txt\", \"r\")\r\ndata=f.read()\r\nprint(data)\r\nf.close()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Output:<\/p>\n<pre>= RESTART: C:\/Users\/lenovo\/AppData\/Local\/Programs\/Python\/Python311\/x.py\r\nClass 12\r\nFile Handling Notes\r\nYou are learning\r\nWriting \/ appending to the text file<\/pre>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-4099 size-full\" src=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Appending_Text_File.png\" alt=\"Appending_Text_File\" width=\"866\" height=\"178\" title=\"\" srcset=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Appending_Text_File.png 866w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Appending_Text_File-300x62.png 300w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Appending_Text_File-768x158.png 768w\" sizes=\"(max-width: 866px) 100vw, 866px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Hope you understand\u00a0 about writing, reading and appending files in python. Let us take an example in which you get Roll Number, Name and Marks of 5 Students from user and store this detail in file &#8216;report.txt&#8217;.\u00a0<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">f=open(\"report.txt\",\"w\")\r\nfor i in range(5):\r\n    roll_no=int(input(\"Roll No:\"))\r\n    name=input(\"Name:\")\r\n    marks=int(input(\"Marks:\"))\r\n    data= str(roll_no)+ \"|\" +name+ \"|\"+str(marks)\r\n    f.write(data)\r\n    f.write(\"\\n\")#To display data in next line\r\nf.close()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Output:<\/strong><\/p>\n<pre>Roll No:1\r\nName:\"Devkaran\"\r\nMarks:28\r\nRoll No:2\r\nName:\"Uday Pratap\"\r\nMarks:25\r\nRoll No:3\r\nName:\"Pratiksha\"\r\nMarks:23\r\nRoll No:4\r\nName:\"Aayushi\"\r\nMarks:21\r\nRoll No:5\r\nName:\"Pallavi\"\r\nMarks:21\r\n&gt;&gt;&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-4103 size-full\" src=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Python_File_handling.jpg\" alt=\"python file handling\" width=\"772\" height=\"502\" title=\"\" srcset=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Python_File_handling.jpg 772w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Python_File_handling-300x195.jpg 300w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Python_File_handling-768x499.jpg 768w\" sizes=\"(max-width: 772px) 100vw, 772px\" \/><\/p>\n<p><strong><span style=\"color: #000000;\">Final Data in Text file:<\/span><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4102 size-full\" src=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Data_in_Text_File.jpg\" alt=\"File handling in Python\" width=\"576\" height=\"187\" title=\"\" srcset=\"https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Data_in_Text_File.jpg 576w, https:\/\/cbsepython.in\/wp-content\/uploads\/2021\/05\/Data_in_Text_File-300x97.jpg 300w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>You must check :<\/strong><\/p>\n<p><span style=\"color: #000000;\"><a style=\"color: #000000;\" href=\"https:\/\/cbsepython.in\/text-file-mcq-question-bank-for-class-12\/\"><strong><span style=\"color: #0000ff;\">Text File MCQs for Class 12<\/span><\/strong><\/a>\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python File Handling Notes for class 12\u00a0 &nbsp; Data File Handling in Python Data maintained inside the files is termed as persistent data. It means it is permanent in nature. Python allow us to read data from and save data to external text files permanently on secondary storage media. Before we start working with a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,20],"tags":[],"class_list":["post-796","post","type-post","status-publish","format-standard","hentry","category-cbse-sample-papers-class-12","category-cbse-computer-science-with-python-class-12"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/comments?post=796"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/796\/revisions"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}