Compiled main program

Clarence Gardner clarence at
Fri Jun 18 11:01:10 EDT 1999

Greg Ewing (greg.ewing at wrote:
: Clarence Gardner wrote:
: > 
: > x = MakeMeMain()
: > del x
: Wouldn't it just be simpler to do
: MakeMeMain()
: Greg

Sure would -- I noticed that after I posted and felt a blush of
embarassment.  That came up because I first wrote

	del MakeMeMain()

(don't ask me why), which is illegal (because you del a name, not a value)
so with a quick jerk of the hand I put in 'x'.

By the way, just to compound my initial stupidity, as was pointed out to
me in email by <sorry, don't have your name>, I didn't need the MakeMeMain()
class at all -- this suffices:

	sys.modules['__main__'] = sys.modules[__name__]

I must have had a mental block when I was trying to think of how to get
a reference to the current module, which made me wander off into class-land.

Clarence Gardner
AvTel Communications
Software Products and Services Division
clarence at

More information about the Python-list mailing list