[Pythonmac-SIG] Yet another problem with path

Kevin Walzer kw at codebykevin.com
Mon Jul 14 03:30:24 CEST 2008


Pascal Bompard wrote:

> 
> I will include some terminal output below to help with diagnostics:
> 
> Successful attempt:
> ----------------------------------------
> pascal$ python /Users/pascal/Documents/Python/Dev/myapps/test.py
> 
> Unsuccessful attempt:
> ----------------------------------------
> pascal$ python test.py
> /System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python: 
> can't open file 'test.py': [Errno 2] No such file or directory

If you are not including the full path to your Python script, then you 
need to change the working directory in Terminal to be the same as the 
script.

Try this command:

cd /Users/pascal/Documents/Python/Dev/myapps
python test.py


-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com


More information about the Pythonmac-SIG mailing list