> exec compile("code", "filename", "exec")
Thanks for the tip!
Works great!
BranoZ
--
http://mail.python.org/mailman/listinfo/python-list
Brano Zarnovican wrote:
> I have a python script represented by a string.
> I need to execute it in a context. 'exec' does
> the job, but doesn't display the filename in
> tracebacks. 'execfile' is displaying the filename
> but it can only exec a script in a filesystem.
>
> I have tried:
> - to gi
Hi !
little idea :
You can save the string, in temp-directory (see tempfile module), then,
use execfile
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list