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":28171,"date":"2015-11-25T19:42:05","date_gmt":"2015-11-26T01:42:05","guid":{"rendered":"http:\/\/juansalvadorfernandez.wordpress.com\/?p=161"},"modified":"2015-11-25T19:42:05","modified_gmt":"2015-11-26T01:42:05","slug":"creating-importing-and-using-python-modules","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/creating-importing-and-using-python-modules\/","title":{"rendered":"Creating, Importing and Using Python modules"},"content":{"rendered":"

A good way to play around with python modules is using functions. In a previous mastery about the programing environment we already reviewed how to create a python file, and a module is just like that, but with the condition is that it has to be able to run by itself if given a parameter, just like a function.<\/p>\n

First we shall create our own module by opening a new file and writing the following function:<\/p>\n

Def smores (x,y):<\/p>\n

C = x + y<\/p>\n

Return c<\/p>\n

Then save the file with the name \u201cCoco.py\u201d in the folder yo store all of your programs.<\/p>\n

Now we can make use of it, as you can probably tell the function above makes an addition of two numbers, if you need to perform this operation in a program, instead of writing it again you can just import it with something called \u201cdot notation\u201d.<\/p>\n

Get to the first line of your code and type the command \u201cImport\u201d, then write the name of your file, in this case Coco, do not write the \u201c.py\u201d. After that go to the part where you need to implement the function and type \u201cCoco\u201d followed by a dot and then the name of the function, in this case \u201csmores\u201d, it should look like this: \u201cCoco.smores()\u201d, place the values you want added inside the parenthesis and there you go! As simple as that.<\/p>\n

As a plus from creating your own modules with useful functions inside of them you can also use some that already come within python or just download some from the internet.<\/p>\n

The import process will be the same for all of the modules, you just have to be careful and be sure you save them all in the same place for easy Access.<\/p>\n

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

A good way to play around with python modules is using functions. In a previous mastery about the programing environment we already reviewed how to create a python file, and a module is just like that, but with the condition is that it has to be able to run by itself if given a parameter, … Continue reading Creating, Importing and Using Python modules<\/span><\/a>\"\"<\/p>\n","protected":false},"author":211,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[913,914,915,916,39],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28171"}],"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\/211"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=28171"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28171\/revisions"}],"predecessor-version":[{"id":28172,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28171\/revisions\/28172"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=28171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=28171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=28171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}