> 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
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
> 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 :
>
> >>
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
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
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
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
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
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
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
...
>>>
10 matches
Mail list logo