modules share variables without class def
Ulrich Backes
ulrich.backes at trw.com
Mon Nov 4 04:20:42 EST 2002
More information about the Python-list mailing list
Mon Nov 4 04:20:42 EST 2002
- Previous message (by thread): Field in SGML file
- Next message (by thread): modules share variables without class def
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi there, from several postings, i compiled the following scheme: # test.py: from func import testf import globalvars globalvars.port = 1 print testf() # -----> 1 OK! # globalvars.py: port = None global port # func.py: import globalvars def testf(): return(globalvars.port) That works. But if i try to use the blank variable name, it fails: # test.py: from func import testf from globalvars import port port = 1 print testf() # -----> None... # globalvars.py: port = None global port # func.py: from globalvars import port def testf(): return(port) Thanks for your advice, Ulrich
- Previous message (by thread): Field in SGML file
- Next message (by thread): modules share variables without class def
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list