{"id":2677,"date":"2020-07-30T13:44:17","date_gmt":"2020-07-30T12:44:17","guid":{"rendered":"http:\/\/www.ihaz.codes\/UoB\/?page_id=2677"},"modified":"2020-07-30T13:47:27","modified_gmt":"2020-07-30T12:47:27","slug":"file-handling","status":"publish","type":"page","link":"https:\/\/www.ihaz.codes\/UoB\/learning-python\/file-handling\/","title":{"rendered":"File handling"},"content":{"rendered":"<p>File handling in python is all about manipulating strings. It requires you to think differently about your I\/O operations. Instead of printing to the screen, you write to a file. Instead of using input, you read from a file.<\/p>\n<div class=\"child_pages child_pages-thumbnail\">\n<div id=\"child_page-2679\" class=\"child_page\" style=\"width:50%;max-width:100%;\"><div class=\"child_page-container\"><div class=\"post_content\"><h4><a href=\"https:\/\/www.ihaz.codes\/UoB\/learning-python\/file-handling\/writing-to-a-file\/\">Reading from a file<\/a><\/h4><div class=\"post_excerpt\">Learn Reading from a file requires you to understand how files work. In this lesson you will learn about file handles, open, close and readline. Try Write a program which will[read more]<\/div><\/div><!-- .post_content  --><\/div><!-- .child_page-container --><\/div><!-- #child_page-2679\" -->\n\n<div id=\"child_page-2686\" class=\"child_page\" style=\"width:50%;max-width:100%;\"><div class=\"child_page-container\"><div class=\"post_content\"><h4><a href=\"https:\/\/www.ihaz.codes\/UoB\/learning-python\/file-handling\/writing-to-a-file-2\/\">Writing to a file<\/a><\/h4><div class=\"post_excerpt\">Learn In this lesson you will learn how to write single values to each line. It will make use of the write mode in python. Try Write a program which will act as a notepad.[read more]<\/div><\/div><!-- .post_content  --><\/div><!-- .child_page-container --><\/div><!-- #child_page-2686\" -->\n\n<div id=\"child_page-2688\" class=\"child_page\" style=\"width:50%;max-width:100%;\"><div class=\"child_page-container\"><div class=\"post_content\"><h4><a href=\"https:\/\/www.ihaz.codes\/UoB\/learning-python\/file-handling\/writing-to-a-csv-file\/\">Writing to a CSV file<\/a><\/h4><div class=\"post_excerpt\">Learn In this lesson you will learn how to write multiple values to each line. It will allow you to create a simple CSV file. Try Write a file which will allow you to add new[read more]<\/div><\/div><!-- .post_content  --><\/div><!-- .child_page-container --><\/div><!-- #child_page-2688\" -->\n\n<div id=\"child_page-2692\" class=\"child_page\" style=\"width:50%;max-width:100%;\"><div class=\"child_page-container\"><div class=\"post_content\"><h4><a href=\"https:\/\/www.ihaz.codes\/UoB\/learning-python\/file-handling\/reading-from-a-csv-file\/\">Reading from a CSV file<\/a><\/h4><div class=\"post_excerpt\">Learn In this lesson you will lean how to use split in order to read records from a CSV file. Try Read through a file with scores in it. Find the highest and lowest[read more]<\/div><\/div><!-- .post_content  --><\/div><!-- .child_page-container --><\/div><!-- #child_page-2692\" -->\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>File handling in python is all about manipulating strings. It requires you to think differently about your I\/O operations. Instead of printing to the screen, you write to a file. Instead of using input, you read from a file.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":332,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"class_list":["post-2677","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/pages\/2677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/comments?post=2677"}],"version-history":[{"count":2,"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/pages\/2677\/revisions"}],"predecessor-version":[{"id":2681,"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/pages\/2677\/revisions\/2681"}],"up":[{"embeddable":true,"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/pages\/332"}],"wp:attachment":[{"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/media?parent=2677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ihaz.codes\/UoB\/wp-json\/wp\/v2\/categories?post=2677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}