Hi!
I did not understand anything with your chatterer message.
But, perhaps, the code below will help you.
@-salutations
Michel Claveau
def runcode(srcode):
import sys,traceback
sret=True
try:
ccod=compile(srcode, 'Paul-code', 'exec')
flagcompile=True
except:
print "compilo-error"
flagcompile=False
if flagcompile==True:
try:
exec(ccod,globals(),globals())
sret=True
except:
tb=sys.exc_info()[2] #for traceback
print str(sys.exc_info()[0])
print traceback.format_exc()
sret=False
return sret
s="""global c
a=1000
b=123
c=a+b"""
if runcode(s):
print c
--
http://mail.python.org/mailman/listinfo/python-list