[Tutor] Starting python from a DOS prompt from any directory?

Alan Gauld alan.gauld at btinternet.com
Sun Dec 31 09:42:24 CET 2006


"Daniel McQuay" <simplebob at gmail.com> wrote

> from a DOS prompt. i am used to running python from a linux box 
> where you
> can just type "python" or "python24" from a shell prompt and the 
> python
> shell executes from any directory.

> testing code. now i am using a windows xp media center edition 
> laptop with
> python 2.5 installed and when i go to run and then type "cmd" and 
> then type
> "python" from the directory where the run "cmd" command drops me it 
> says
> 'python' is not a recognized as an internal or external command.

You need to set up your PATH environment variable to include the
python directory. You do this on XP(not so sure about Media Centre!)
via the MyComputer->Properties->Advanced->Environment Variables route
Once there you need to find the PATH variable and edit it to add the
folder where Python lives (look at the properties of the shortcut to
Python that you normally use to stat it).

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list