[Tutor] running a .py file from the comand line

Alan Gauld alan.gauld at yahoo.co.uk
Mon Apr 2 04:53:27 EDT 2018


On 02/04/18 01:46, Rex Florian via Tutor wrote:
> Hello,
> 
> I am running Python 3.6 in a Window 7 environment. > I have a python script that I am trying to run from the command line.

> I have copied it to a file named Ascii Keys.py into my user directory c:\Users\Rex
> 
> I try to execute the file by typing python Ascii Keys.py 

Try

python c:\Users\Rex\"ascii keys.py"

Note the quotes to cater for the space.

> python:  can't open file 'Ascii':  [errno2] no such file or directory

The space confuses windows CMD, so it thinks you have
two files called 'Ascii' and 'keys.py'

By quoting the name it should see it as a single file name.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list