[Tutor] Invoking Python

Alan Gauld alan.gauld at btinternet.com
Thu Jun 26 10:59:46 CEST 2008

"kinuthiA muchanE" <muchanek at gmail.com> wrote

>>From the forward slashes in the file path I assume you are
> using a Linux based OS

> you need to to start the terminal or the shell. In Ubuntu, go to 
> Main
> Menu ==> Accessories and click on Terminal, you will now have a new
> window open with something like this --- kinuthia at tchane:~$ .
> Enter the name "python" followed by the name of your file.

Or more commonly add a first line like:

#! /path/to/python/executable

Then you can simply make the file executable and run it by typing its 

$ threeplusfour.py

or double clicking it in your favourite file manager GUI tool.

See the topic "Add a Little style" in my tutorial,  in the box
Note for Unix users
for more details.

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list