On Sat, Sep 18, 2010 at 10:16 AM, Fernando Karpinski
<fanger2...@gmail.com>wrote:

>
>    Hi, everyone. I need help when importing a file I created, with the .py
> extension. I am trying to access its directory in DOS, and after I do it, I
> type "import filename", but it is not working. I tried to do it by writing
> "import filename.py", but it didn't work either. I'm aware that after the
> first import, I should either call the reload function or restart the
> session, but I can't even import the file successfully once. I am using
> Python 2.7. Thanks in advance for your help.
>
>    F
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
your file needs to be in the same directory as your program or in the
sys.path list

you don't use the extension.

import filename

is all you need, not import filename.py

-- 
Joel Goldstick
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to