Start Python at client side from web app

Diez B. Roggisch deets at nospam.web.de
Wed Jan 21 05:21:34 EST 2009


James Stroud wrote:

> Thomas Guettler wrote:
>> Hi,
>> 
>> I want to start Python at the client side from a web application. The
>> app is an intranet application, and all client PCs are under our control
>> (we can install software on them).
>> 
>> But I don't want to update the installation too often. Here is my idea:
>> 
>> We create a custom mime-type and register it on the client PC. The web
>> application can send signed python code to the client PC. If the
>> signature is correct, the code will be executed at the client. The
>> signature prevents others from executing code.
>> 
>> Has someone seen or done something like this before?
>> 
>> I can code this myself, but prefer to use some open source project, if it
>> exists.
>> 
>> 
>> Thanks in advance,
>>   Thomas Güttler
>> 
> 
> You are better off using a cron job (or similar) on the client side,
> getting the client to hit the web server for the code at regular
> intervals, and if code is ready, execute. If code isn't ready, wait for
> the next interval. Use https for security and have a shared secret
> message to identify legitimate clients.
> 
> If you try to push code the other way, you will need a perpetual socket
> open on the client side, making the client the server.

If the OP finds a method to trigger the execution of his program, the
question of who's client and who not is moot. If he wants, he can make the
software query a server via HTTP (he's got that up & reachable from the PC
anyway) for it's new code. All he needs is some session-key being passed on
invocation.

Diez



More information about the Python-list mailing list