Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15967

Re: Server Questions (2 of them)

References <4c5cedc5-65e4-4bca-a7fe-7afffde79c88@s6g2000vbc.googlegroups.com>
Date 2011-11-21 08:34 +1100
Subject Re: Server Questions (2 of them)
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2876.1321824872.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Nov 21, 2011 at 7:02 AM, Andrew <andrew.chapkowski@gmail.com> wrote:
> Hello List,
>
> How to do you create a server that accepts a set of user code?
>
> For example,
>
> I would like to send this function:
> def addition(x,y):
>   return x+y
> and have the socket server perform the operation and send is back to
> the end user.
>
> Question 2:
> On that same server, I want a user to be able to pass a file to the
> server along with code.  What is the best way to pass file to the
> server?

The easiest way is to write an HTTP server (Python has some tools that
will make this easy) and use an HTML form, which can do file uploads
as well as accept keyed-in code.

However, you will run into some fairly major security issues. You're
accepting code across the internet and running it. Python does not
protect you against malicious users reading files from your hard disk
or, worse, modifying those files. This sort of thing can ONLY be used
in a trusted environment - a local network on which you know
everything that's happening.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Server Questions (2 of them) Andrew <andrew.chapkowski@gmail.com> - 2011-11-20 12:02 -0800
  Re: Server Questions (2 of them) Chris Angelico <rosuav@gmail.com> - 2011-11-21 08:34 +1100
  Re: Server Questions (2 of them) Hrvoje Niksic <hniksic@xemacs.org> - 2011-11-20 22:44 +0100
    Re: Server Questions (2 of them) Christian Heimes <lists@cheimes.de> - 2011-11-21 01:27 +0100
      Re: Server Questions (2 of them) alex23 <wuwei23@gmail.com> - 2011-11-20 20:26 -0800
  Re: Server Questions (2 of them) Nizamov Shawkat <nizamov.shawkat@gmail.com> - 2011-11-21 07:28 +0100

csiph-web