"elis aeris" <[EMAIL PROTECTED]> wrote
> ok, i can import them.
>
> how do I use them though?
When you import the module the code is executed.
If you have executable code rather than function or
class definitions then it will be executed (print
statements etc). Thats why its always good pra
> ok, i can import them.
>
> how do I use them though?
That's also in the tutorial; if there are variables (constants)
instead of functions in your module, it works just the same.
> > I have some .py files that have things I need to use, sometimes
> > it's the functions and sometimes it's the
> 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
(without the .py extension).
If they're i
ok, i can import them.
how do I use them though?
On Nov 26, 2007 1:42 AM, Evert Rol <[EMAIL PROTECTED]> 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
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?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman