Newbie Question (executing Program from within)
Matt Gerrans
mgerrans at mindspring.com
Mon Jun 10 03:26:01 EDT 2002
More information about the Python-list mailing list
Mon Jun 10 03:26:01 EDT 2002
- Previous message (by thread): Backwards emulation rather than backwards compatibility?
- Next message (by thread): Newbie Question (executing Program from within)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
# This will do the trick:
def runScript(filename):
namespace = { '__name__' : '__main__' }
execfile(filename, namespace)
return namespace
# - mfg
- Previous message (by thread): Backwards emulation rather than backwards compatibility?
- Next message (by thread): Newbie Question (executing Program from within)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list