| welcome to social.hackers | posts are made by Clocwork and Shadowdrifter | added some new hack diaries + podcasts |

Friday, June 3, 2011

Programming Lesson Number one.

This is the first edition to the Shadowdrift programming lessons. During these lessons I will be teaching you the basics of the Python language. Today’s lesson will be on installing Python, using modules, and assigning variables. Installing Python is very straightforward go to this link and download the first file . After running the MSI installer you will be able to run Python programs. Now similar to headers in C/C++ Python stores functions in modules which are easily imported with something as simple as import modulename. At the end of this lesson I will include some code you can easily use to test these modules. The third, and final part of our lesson is assigning variables. To assign a variable in python you will write it like this variablename = variable i.e a = ‘123’. The following code uses Python of course, and the two things we have covered modules and variables.

    import time
    a = time.time()
    print a
    time.sleep(3)

No comments:

Post a Comment