sending executable data over network..

Piyush Anonymous piyush.subscription at gmail.com
Tue Jun 24 08:47:33 EDT 2008


any idea or pointer how i could link it to running code in server?
for example, i get a new method definition for a method and i wish to change
it.
client sent new definition, i compile it in server. how can i link it to old
code?
if it will running in same environment, i would write
objectA.getdata()=getdatanew()

here?

On Tue, Jun 24, 2008 at 4:15 PM, Cédric Lucantis <omer at no-log.org> wrote:

> Le Tuesday 24 June 2008 08:59:40 Piyush Anonymous, vous avez écrit :
> > hi,
> > i wish to change the way the function definition at run time in a running
> > server. new function code which is to be executed is provided by a client
> > at different location.
> > i am getting it by reading a file and sending it using makefile() with
> > server/client connected using sockets.
> >
> > how can make the lines received in a string array as new function
> > definition? or should i receive it in a different way?
> >
> > is there any better way to do the entire thing?
>
> One way is to transmit the code as a string and compile it on server-side
> with
> the 'compile' builtin function. Another is to compile it on client-side and
> transmit the resulting code object with the marshal module but there are
> many
> restrictions on it (specially the fact that the client and server will have
> to run the same python version) so carefully read the docs first. I'd
> choose
> the first solution, eventually using the pickle module to avoid encoding
> problems.
>
> --
> Cédric Lucantis
> --
> http://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080624/ace99c5d/attachment.html>


More information about the Python-list mailing list