Re: execfile() on file subclass or string

2005-03-24 Thread Brano Zarnovican
> exec compile("code", "filename", "exec") Thanks for the tip! Works great! BranoZ -- http://mail.python.org/mailman/listinfo/python-list

Re: execfile() on file subclass or string

2005-03-24 Thread Fredrik Lundh
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

Re: execfile() on file subclass or string

2005-03-24 Thread Do Re Mi chel La Si Do
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