> > code='"""\n>>> n\n6\n"""\nn=6\nimport doctest\ndoctest.testmod()' > exec(code) >
Remove 'doctest.tesmod()' and the import from your 'code' string. ]]] exec(code) ]]] import doctest ]]] doctest.testmod() should do the trick. Cheers, SB -- http://mail.python.org/mailman/listinfo/python-list