[Tutor] python: can't open file 'ex1.py' : [Errno 2] No such file or directory
Karim
karim.liateni at free.fr
Wed Aug 25 07:16:23 CEST 2010
If it is in the sys.path you should import it: *import ex1*.
Then execute something like *ex1.main()* if you did a main().
Other python *<path to ex.py>/ex.py* should world.
Regards
Karim
On 08/25/2010 05:22 AM, Carter Danforth wrote:
> Hi everyone,
>
> This is my first email to group - I'm just starting to pick up Python
> and I'm going through the exercises in Zed Shaw's "Learn Python the
> Hard Way" ebook. Anyhow, I can't seem to be executing any files in
> terminal for some reason, in this case the file ex1.py:
>
> C:\Users\Carter Danforth\python ex1.py
> python: can't open file 'ex1.py': [Errno 2] No such file or directory
>
> ex1.py is located in "pythonpractice" on my desktop and I've updated
> the modules, here's the output from sys.path:
>
> ['', 'C:\\Windows\\system32\\python27.zip', 'C:\\Users\\Carter
> Danforth\\Desktop\\pythonpractice', 'C:\\Python27\\DLLs',
> 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win',
> 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27',
> 'C:\\Python27\\lib\\site-packages']
>
> And the environmental variable is set to have python on my path:
>
> C:\Users\Carter Danforth>python
> Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit
> (AMD64)] on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> >>>
>
> I'm not sure why I keep getting this error message and why I'm not
> able to execute any .py files. Any help would be great appreciated.
>
> Carter
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100825/563cb9c6/attachment.html>
More information about the Tutor
mailing list