Why I need to declare import as global in function
didier.doussaud at gmail.com
didier.doussaud at gmail.com
Wed Nov 30 03:52:10 EST 2005
More information about the Python-list mailing list
Wed Nov 30 03:52:10 EST 2005
- Previous message (by thread): Why I need to declare import as global in function
- Next message (by thread): sha1,256,512 on files
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
lot's of solutions proposed in the discussion works fine :
file run.py :
----------------
def run_ut( test ) :
# to have the problem the execfile MUST be in a function
# execfile( test ) # ERROR
execfile( test, globals() ) # OK
exec "import ut_00" # OK
exec file(test).read() # OK
run_ut( "ut_00.py" )
Thanks a lor
- Previous message (by thread): Why I need to declare import as global in function
- Next message (by thread): sha1,256,512 on files
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list