A Practical Introduction to Python Programming

Categories:

Recommended

This chapter will get you up and running with Python, from downloading it to writing simple programs.

1.1 Installing Python

Go to www.python.org and download the latest version of Python (version 3.5 as of this writing). It should be painless to install. If you have a Mac or Linux, you may already have Python on your computer, though it may be an older version. If it is version 2.7 or earlier, then you should install the latest version, as many of the programs in this book will not work correctly on older versions.

1.2 IDLE

IDLE is a simple integrated development environment (IDE) that comes with Python. It’s a program that allows you to type in your programs and run them. There are other IDEs for Python, but for now I would suggest sticking with IDLE as it is simple to use. You can find IDLE in the Python 3.4 folder on your computer.

When you first start IDLE, it starts up in the shell, which is an interactive window where you can type in Python code and see the output in the same window. I often use the shell in place of my calculator or to try out small pieces of code. But most of the time you will want to open up a new window and type the program in there.

At least on Windows, if you click on a Python file on your desktop, your system will run the program, but not show the code, which is probably not what you want. Instead, if you right-click on the file, there should be an option called Edit with Idle. To edit an existing Python file, either do that or start up IDLE and open the file through the File menu.

Category:

Attribution

Brian Heinold. A Practical Introduction to Python Programming. https://www.brianheinold.net/python/

VP Flipbook Maker

Convert your work to digital flipbook with VP Online Flipbook Maker! You can also create a new one with the tool. Try it now!