[Tutor] Running Python from REVO screen???

Lie Ryan lie.1296 at gmail.com
Sun Nov 16 12:19:53 CET 2008


On Sun, 16 Nov 2008 02:06:30 -0800, WM. wrote:

> I asked tutor how to get to the black screen to run Python programs.  I
> got a three step answer but could not get step 1. to work;
> 
> 1.
> XP: Start > Run > type "cmd" > OK
> 
> C:\Documents and Settings
> The above line is where I wind up & I cannot get out of it.  I can get
> into it with Start > Programs > Accessories > Command Prompt.
>
> The below lines I have not yet gotten to.  What is 'cd'?
> 
> 2.
> then cd to the folder where you put the script: 
> C:\> cd C:\mypython\
> 'cd'?

cd is for _c_hange _d_irectory

short tutorial on 'cd':
cd .. -> go to parent directory
cd <absolutepath> -> go to the path
cd <relativepath> -> go to the path relative to the current directory
<absolutepath> is a path that starts with drive letter, e.g. C:\mydir\blah
<relativepath> doesn't start with drive letter, e.g. mydir

if the path contains a space, enclose the path in double quote (I think 
Windows' cd is not as strict as linux's cd, but just in case)

type "help cd" for more information

the current directory is denoted before the prompt (i.e. if the prompt is 
"C:\mypath> " then the current directory is "C:\mypath"). The parent 
directory is the directory above the current directory, i.e. if current 
directory is C:\mypath, the parent directory is C:\

other useful commands:
dir -- lists the file and folders in the current directory

> 3.
> then run the program by typing "python blah.py" C:\mypython\> python
> blah.py



More information about the Tutor mailing list