[Tutor] does python have something like "#include" in C?
Kent Johnson
kent37 at tds.net
Mon Jun 29 20:49:07 CEST 2009
On Mon, Jun 29, 2009 at 1:46 PM, wesley chun<wescpy at gmail.com> wrote:
> take your function definition and store in a file called, say
> showmodule.py. then put the remaining code inside something like
> foo.py. at the top of foo.py, you'll need:
>
> from showmodule import show
>
> then everything else will work.
I don't think so. The exec in show() must be run in the namespace in
which the symbols being displayed are defined.
Kent
More information about the Tutor
mailing list