Tuesday, 24 May 2011

Python Files

This is just a quick lesson to learn about opening and creating new Python files.

To begin, open the Python Shell (IDLE). Go to File -> New Window, or press Ctrl + N if you are on Windows. You should see the following window.




This is where you will write your programs code. It doesn't work like the Shell. The interpreter doesn't wait for your input like with the Shell, here you write your code, and then you can run the program. To do so, go to:
Run -> Run Module

To save your files, you just need to go to File -> Save As... and chose your file location and name. The file extension should be .py (eg. helloWorld.py).

That's it for this lesson. Continue on to the next lesson: Naming Conventions and More

-Nathan (everythingPython)

No comments:

Post a Comment