Re: exec and global puzzle

2004-12-06 Thread Steve Holden
Andr? Roberge wrote: I have the following two files: #--testexec.py-- def exec_code(co): try: exec co except: print "error" #-- test.py-- import thread import testexec import time code = "def a():\n print 'a'\n\n" +\ "def c():\n a()\n\nc()" code2 = "def a():\n print '

exec and global puzzle

2004-12-05 Thread Andr? Roberge
I have the following two files: #--testexec.py-- def exec_code(co): try: exec co except: print "error" #-- test.py-- import thread import testexec import time code = "def a():\n print 'a'\n\n" +\ "def c():\n a()\n\nc()" code2 = "def a():\n print 'a'\n\n" +\