"compile()" portability

Just just at xs4all.nl
Sat Nov 22 07:26:35 EST 2003


In article <mailman.987.1069497456.702.python-list at python.org>,
 Vio <vmilitaru at sympatico.ca> wrote:

> I would like to know if executing:
> 
>    c = compile('a=5\nprint a','<string>','exec')
> 
> 
> on a Linux box, then pickling+beaming the result on a Windows box, will give 
> me the expecting result:
> 
> >>> exec(c)
> 5
> 
> In other words, does 'compile()' generate platform-dependent code?

If you mean "marshal" instead of "pickle", and use the same (major) 
Python version on both ends, then yes.

Just




More information about the Python-list mailing list