Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":28453,"date":"2015-11-25T23:46:48","date_gmt":"2015-11-26T05:46:48","guid":{"rendered":"http:\/\/saldabal.wordpress.com\/?p=192"},"modified":"2015-11-25T23:46:48","modified_gmt":"2015-11-26T05:46:48","slug":"open-and-read-files","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/open-and-read-files\/","title":{"rendered":"Open and read files"},"content":{"rendered":"

This was a very challegnig thing i’ve got to get through in\u00a0 the semester.<\/p>\n

To learn how to open and read files i had to read a lot of times the same thing of the “How to think like a computer scientist”<\/p>\n

There are special words to do this how ever the esscentials does not need you to import any module which is good for us.<\/p>\n

First of all we have to tell python we want to open a file, to do this we must type set a variable and set the open to it like this:<\/p>\n

variable = open(“name of the file.txt”, “r”)<\/p>\n

It is very important that we put our paraeters in this case within quot marks, as you see up you have to type an ‘r’ after the name of the text which indicates that is reading.<\/p>\n

Now we have it open we have to read it.<\/p>\n

To read the text we can choose between read line by line orto read all of them.<\/p>\n

1 line at a time: variable = previous_variable.readline()<\/p>\n

all of them: variable = previous_variable.readlines()<\/p>\n

From here you just haveto get creative and do the stuff you want. And just dont remember that always at the end you must close your text with:<\/p>\n

variable.close<\/p>\n

An example:<\/p>\n

archivo = open(‘bananas.txt’, ‘r’)<\/p>\n

one = archivo.readline()<\/p>\n

print (one)<\/p>\n

close.archivo<\/p>\n

 <\/p>\n

Hope you enjoy it!<\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

\"\"<\/a> \"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

This was a very challegnig thing i’ve got to get through in  the semester. To learn how to open and read files i had to read a lot of times the same thing of the “How to think like a… Continue Reading →<\/a>\"\"<\/p>\n","protected":false},"author":202,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[923,62],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28453"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/users\/202"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=28453"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28453\/revisions"}],"predecessor-version":[{"id":28454,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28453\/revisions\/28454"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=28453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=28453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=28453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}