[Tutor] Help - importing modules
Joel Goldstick
joel.goldstick at gmail.com
Sat Sep 18 17:01:42 CEST 2010
On Sat, Sep 18, 2010 at 10:16 AM, Fernando Karpinski
<fanger2099 at 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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100918/903a39d7/attachment.html>
More information about the Tutor
mailing list