Re: Global var access in imported modules?

2008-08-27 Thread RgeeK
Dennis Lee Bieber wrote: On Wed, 27 Aug 2008 16:21:03 -0400, RgeeK <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: I have a main module doStuff.py and another module utility.py. At the start of doStuff.py I call import utility.py I hope not... import utility

Re: Global var access in imported modules?

2008-08-27 Thread RgeeK
Fredrik Lundh wrote: >>import utility.py > that tries to import a module named "py" from the package "utility". oops - that was just a typo in my post - I meant of course "import utility" > > Python doesn't have "program-wide global" variables; if you need that, > create a support module and

Re: Global var access in imported modules?

2008-08-27 Thread Rgg
Fredrik Lundh wrote: import utility.py that tries to import a module named "py" from the package "utility". oops - that was just a typo in my post - I meant of course "import utility" Python doesn't have "program-wide global" variables; if you need that, create a support module and impor

Re: Global var access in imported modules?

2008-08-27 Thread Fredrik Lundh
RgeeK wrote: I have a main module doStuff.py and another module utility.py. At the start of doStuff.py I call import utility.py that tries to import a module named "py" from the package "utility". Then I also proceed to initiallize some global variables sName = "" Within my utility.

Re: global var

2005-02-21 Thread Jeff Shannon
Nick Coghlan wrote: Michael Hoffman wrote: raver2046 wrote: How to have a global var in python ? "global var" will give you a global variable named "var". Whether this advice is correct or not depends greatly on what the OP means by 'global' :) Module global, it's right, application global it's w

Re: global var

2005-02-19 Thread Nick Coghlan
Michael Hoffman wrote: raver2046 wrote: How to have a global var in python ? "global var" will give you a global variable named "var". Whether this advice is correct or not depends greatly on what the OP means by 'global' :) Module global, it's right, application global it's wrong. Given the nat

Re: global var

2005-02-17 Thread Steven Bethard
raver2046 wrote: How to have a global var in python ? You can, but you probably don't want to. What's your use case? Example code and what you'd like it to do would be helpful. STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: global var

2005-02-17 Thread Michael Hoffman
raver2046 wrote: How to have a global var in python ? "global var" will give you a global variable named "var". -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list