[Tutor] How do I squish this bug?
Max Noel
maxnoel_fr at yahoo.fr
Mon May 9 21:10:01 CEST 2005
On May 9, 2005, at 17:57, Joseph Quigley wrote:
> Why do I get the error:
> NameError: global name 'main' is not defined
>
> when switching between the two module twice (ie: type: jargon
> type:back()
> type:jargon type:back() )?
>
> Thanks
> JQ
>
Namespaces. Each module has its own namespace. To run the
function "main" from the imported module "jargon_file", you have to
call jargon_file.main().
Feels a bit weird at the beginning, but after using them for a
little while, you suddenly realize that namespaces are an instance of
BestThingEver.
By the way, it looks like your code induces an endless recursion
in an attempt to emulate GOTO statements (been programming in a
variant of BASIC?). That's a Bad Thing.
-- Max
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
mailing list