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 u

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

Global var access in imported modules?

2008-08-27 Thread RgeeK
I have a main module doStuff.py and another module utility.py. At the start of doStuff.py I call import utility.py Then I also proceed to initiallize some global variables sName = "" Then I create a class, some methods etc. In one of the methods I assign a value to my variable sName. Th

Re: Unexpected global variable behaviour

2008-08-26 Thread RgeeK
Thanks a lot Fredrik, A big wave of deja vu came over me as I read your note. That bit me once before, and was my only previous run-in with the 'global' directive which clearly didn't stick with me. :( Thanks for the concise, helpful reply. The universe makes sense again. -Ross. Fredrik

Unexpected global variable behaviour

2008-08-25 Thread RgeeK
I'm seeing something which make me think I'm missing something about how global var's behave. I've defined a global string, right at the start of my .py file. outXMLfile = "abc" I define a class and do a bunch of stuff below that. Then I have another class, and in it, there is a method 'de

Re: Graphics Contexts and DCs explanations?

2008-08-21 Thread RgeeK
Chris Mellon wrote: This is probably better suited to the wxPython ML instead of c.l.p, because it's so specific. In short: wxDC (and friends) are traditional raster based drawing contexts. wxGraphicsContext is a vector/path based API. If you're doing drawing that's suited for a vector format (l

Graphics Contexts and DCs explanations?

2008-08-19 Thread RgeeK
Experimenting with graphics in an app: it's AUI based with a few panes, one of which has a panel containing a few sizers holding UI elements. One sizer contains a panel that needs some basic line-drawing graphics in it. I use the wxPython demo app heavily to figure this stuff out, and my expe