Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-16 Thread Daniel Fetchinson
> I am trying to serialize a function, class, etc and transfer it, have it > unserialized and used. You might want to look at pyro: http://pyro.sourceforge.net/ and also picloud: http://www.picloud.com/ HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://ma

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-16 Thread Gabriel Rossetti
Andreas Löscher wrote: import types import marshal def a(): pass ... s=marshal.dumps(a.__code__) f=types.FunctionType(marshal.loads(s), {}) f What version of python do you have? If I try your code above I get : >>> import type

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-15 Thread Andreas Löscher
> import types > import marshal > def a(): pass > > > ... > > > s=marshal.dumps(a.__code__) > f=types.FunctionType(marshal.loads(s), {}) > f > > > > > > > What version of python do you have? If I try your code above I get : > > >>

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-15 Thread Gabriel Rossetti
Andreas Löscher wrote: Am Mittwoch, den 14.04.2010, 11:33 +0200 schrieb Gabriel Rossetti: Paul Rubin wrote: Gabriel Rossetti writes: I am trying to serialize a function, class, etc and transfer it You mean the actual code? You have to use marshal rather than

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-14 Thread Andreas Löscher
Am Mittwoch, den 14.04.2010, 12:37 +0200 schrieb Gabriel Rossetti: > Andreas Löscher wrote: > > Am Mittwoch, den 14.04.2010, 11:33 +0200 schrieb Gabriel Rossetti: > > > >> Paul Rubin wrote: > >> > >>> Gabriel Rossetti writes: > >>> > >>> > I am trying to serialize a function

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-14 Thread Gabriel Rossetti
Andreas Löscher wrote: Am Mittwoch, den 14.04.2010, 11:33 +0200 schrieb Gabriel Rossetti: Paul Rubin wrote: Gabriel Rossetti writes: I am trying to serialize a function, class, etc and transfer it You mean the actual code? You have to use marshal rather than

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-14 Thread Andreas Löscher
Am Mittwoch, den 14.04.2010, 11:33 +0200 schrieb Gabriel Rossetti: > Paul Rubin wrote: > > Gabriel Rossetti writes: > > > >> I am trying to serialize a function, class, etc and transfer it > >> > > > > You mean the actual code? You have to use marshal rather than pickle, > > the Python ve

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-14 Thread Gabriel Rossetti
Paul Rubin wrote: Gabriel Rossetti writes: I am trying to serialize a function, class, etc and transfer it You mean the actual code? You have to use marshal rather than pickle, the Python versions have to be the same at both ends, and you better have some kind of authenticated transp

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-14 Thread Paul Rubin
Gabriel Rossetti writes: > I am trying to serialize a function, class, etc and transfer it You mean the actual code? You have to use marshal rather than pickle, the Python versions have to be the same at both ends, and you better have some kind of authenticated transport to stop malicious code f

Object serialization: transfer from a to b (non-implemented code on b)

2010-04-14 Thread Gabriel Rossetti
Hello everyone, I am trying to serialize a function, class, etc and transfer it, have it unserialized and used. The thing is that this code is not defined on the receiving side and thus it does not work. I tried the following tests: Terminal A: >>> import pickle >>> def test(): pass ... >>>