global variables or inheritence

Jeff Massung jmassung at magpiesystems.com
Wed Apr 26 16:41:26 EDT 2000


Thomas Rasmussen wrote in message <28pzoqghaoh.fsf at lada.kom.auc.dk>...
>  Jeff> NOTE: myvar is local to main() (not to the file)
>Well I still want to be able to do this....

Well, you can't :), so you're going to have to find another way to do what
you want.

>Well i'm programming a small admin tool, which must use the users
>$EDITOR for editing files. This works fine if the EDITOR sysenv is
>set, if not, then i want to ask the user which editor he want to use,
>and then pass this variable to the module that handles
>filemanipulation. This modules is also in another file if it
>matters... I must add that this is my first real program made in
>python...

Definitely no need for circular code there, just rethink it through some
more - try a simple program of what you want with only 1 file for now.

As for circular code, think of it like this:

def CodeA():
    def CodeB():
        CodeA()
    CodeB()

What happens? Ouch ;) Stay away... very bad...

Jeff





More information about the Python-list mailing list