[Tutor] Re: [Pythonmac-SIG] Weird import problem with PythonIDE
on Mac (was 'import problem')
maxnoel_fr at yahoo.fr
Fri Apr 22 17:00:23 CEST 2005
On Apr 22, 2005, at 11:41, Chris Smith wrote:
> Do you have a suggestion as to what can I give a module so it has
> enough information to execute a function that resides in __main__?
> Here is a visual of what is going on:
> def y1():
> import foo
> foo.run(string_from_main) #what should I pass?
> ------external module, foo
> def run(string_from_main):
> exec(string_from_main) #y1 is run as if it were in __main__
Python makes it easy to do because functions (and classes) are
# in __main__
# in foo
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal machine?"
More information about the Tutor