{"id":39179,"date":"2016-11-23T21:25:01","date_gmt":"2016-11-24T03:25:01","guid":{"rendered":"http:\/\/a01228858.wordpress.com\/?p=319"},"modified":"2016-11-23T21:25:01","modified_gmt":"2016-11-24T03:25:01","slug":"reading-and-writing-of-text-files-10","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/reading-and-writing-of-text-files-10\/","title":{"rendered":"Reading and writing of text files"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/a01228858.wordpress.com\/2016\/11\/24\/reading-and-writing-of-text-files\/\"><a href=\"https:\/\/a01228858.wordpress.com\">Py(t)hon<\/a><\/a><\/em><br \/><\/p>\n<p>Computers can also read and write, for them to do so we have to first create a .txt file and we do this by typing file = open(\u201cfile name\u201d, \u201caction\u201d).<\/p>\n<p>The next thing that we can do are the next ones:<\/p>\n<ul>\n<li>\u201cw\u201d this is use to write in a .txt file<\/li>\n<li>\u201cr\u201d this is use to read<\/li>\n<li>\u201ca\u201d open the file for apending<\/li>\n<\/ul>\n<p>Here is an example:<\/p>\n<p><img class=\"alignnone size-full wp-image-322\" src=\"https:\/\/a01228858.files.wordpress.com\/2016\/11\/txt1.png?w=1000\" alt=\"txt1\" srcset=\"https:\/\/a01228858.files.wordpress.com\/2016\/11\/txt1.png 291w, https:\/\/a01228858.files.wordpress.com\/2016\/11\/txt1.png?w=150 150w\" sizes=\"(max-width: 291px) 100vw, 291px\"   \/><\/p>\n<p>That&#8217;s all #Pug#ISC#Tec#NoMore#Python#TextFiles<\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/a01228858.wordpress.com\/319\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/a01228858.wordpress.com\/319\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=a01228858.wordpress.com&#038;blog=115152340&%23038;post=319&%23038;subd=a01228858&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Py(t)hon Computers can also read and write, for them to do so we have to first create a .txt file and we do this by typing file = open(\u201cfile name\u201d, \u201caction\u201d). The next thing that we can do are the next ones: \u201cw\u201d this is use to write in a .txt file &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/reading-and-writing-of-text-files-10\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Reading and writing of text files<\/span><\/a><\/p>\n","protected":false},"author":28,"featured_media":322,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[34,376,42,33,36,387],"class_list":["post-39179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-isc","tag-nomore","tag-pug","tag-tc101","tag-tec","tag-textfiles"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/39179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=39179"}],"version-history":[{"count":13,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/39179\/revisions"}],"predecessor-version":[{"id":42585,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/39179\/revisions\/42585"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=39179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=39179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=39179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}