[Tutor] use my own code

elis aeris hunter92383 at gmail.com
Sun Nov 25 18:43:48 CET 2007


ok, i can import them.


how do I use them though?





On Nov 26, 2007 1:42 AM, Evert Rol <evert.rol at gmail.com> wrote:

> > I have some .py files that have things I need to use,  sometimes
> > it's the functions and sometimes it's the whole .py (they have no
> > functions)
> >
> > how do I use them in my other .py codes?
>
> Import them at the top of your other .py file(s):
>
> import <yourfile>
>
> (without the .py extension).
> If they're in the current directory, you're fine. Otherwise you may
> need to set the PYTHONPATH variable.
> See chapter 6 in the Python tutorial, especially section 6.1.1:
> http://docs.python.org/tut/node8.html#SECTION008110000000000000000
>
>  Evert
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071126/f2595698/attachment.htm 


More information about the Tutor mailing list