[Tutor] Running Existing Python

Walter Prins wprins at gmail.com
Sat Feb 26 23:18:18 CET 2011


On 26 February 2011 21:18, Justin Bonnell <jwbonnell5 at gmail.com> wrote:

> --I tried to follow this using:
> /jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py
> which is the correct location of the hello.py file.
>

Try putting quotes around the full path. The problem is that the space
between "Python" and "2.7" makes the line look like 2 arguments, e.g.
 /jwbonnell/bin/Python
... and ...
2.7/Extras/Demo/tkinter/guido/hello.py

If you double quote the entire string like so:
"/jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py"

By quoting the line you're telling the system not to interpret that space
and make it part of the argument to the Python interpreter.  (Aside: You
would need to quote the path also when using it with the "cd" command, as
the same problem will happen unless you quote it.)

The other thing I'd suggest is to just use IDLE which may be slightly easier
at this point.  In the main IDLE shell, click "File"->"Open", open the file
(it opens in its own window) then run it from there using e.g. F5.  The
output appears in the IDLE shell then.

Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110226/f03a3b43/attachment-0001.html>


More information about the Tutor mailing list