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


Groups > comp.lang.python > #66068

Re: Top down Python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'interpreter': 0.05; 'subject:Python': 0.06; 'front-end': 0.07; 'http': 0.09; 'oh,': 0.09; 'restart': 0.09; 'tcp/ip': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'wrote': 0.14; 'bit.': 0.16; 'calculator': 0.16; 'firewalls,': 0.16; 'flush': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'it;': 0.16; 'repl': 0.16; 'sorts': 0.16; 'think.': 0.16; 'timeout': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'else,': 0.19; 'thu,': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'propose': 0.24; 'recognize': 0.24; 'connected': 0.24; 'fine': 0.24; 'cc:2**0': 0.24; 'somewhere': 0.26; 'supported': 0.26; 'header:In-Reply-To:1': 0.27; 'michael': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; '13,': 0.31; 'away.': 0.31; 'cgi': 0.31; 'though.': 0.31; 'maintaining': 0.32; 'another': 0.32; 'everyone': 0.33; 'running': 0.33; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'doing': 0.36; 'too': 0.37; 'server': 0.38; 'needed': 0.38; 'short': 0.38; 'anything': 0.39; 'system.': 0.39; 'either': 0.39; 'how': 0.40; 'worry': 0.60; 'gone': 0.61; 'browser': 0.61; 'kind': 0.63; 'more': 0.64; 'movie': 0.65; 'between': 0.67; 'flash': 0.69; 'yourself': 0.78; 'etc,': 0.84; 'subject:Top': 0.84; 'tricky': 0.84; 'unclear': 0.84; 'spoke': 0.91; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=L/Gfh79iocHq0bnVKoJ+Az8op08WUEe6NznB9h2APhg=; b=ZJtqReOuL78HnffbcH3/jdI0Efq11q4u2UmRjbSVkInDlrkuJmwaqLbTGdapz+v6KA O5rVrZrIozaQGmMSHdSyWezSsv9/owlMCrlgX2cnVNoftjGEz/cpdntmSAnKeNSvvgWD 1hNOlwGFpCjCLp5zHVF8dIntCM/zWbU4pIHHeU1tsI2mNJpi/j0+x1qRn7aRvPRD9sPQ UNqE9h32JbA2SDLfBrkvvaO4f2cnbQIHJ9WWY6JzdBjqZNL2qvcaLdBDbbyMqsVBBqE4 sHvIdxFyXBPRlAFWN/S0s6j3XhSKEZkIMnG3O4ajhCpSi0EutZR7fJzsNKMII2zn5nUL oZXA==
MIME-Version 1.0
X-Received by 10.66.118.71 with SMTP id kk7mr40775420pab.14.1392228773407; Wed, 12 Feb 2014 10:12:53 -0800 (PST)
In-Reply-To <52FBB625.10906@gmail.com>
References <52FB1D27.8090009@allsup.co> <52FBA40C.3040806@allsup.co> <52FBB625.10906@gmail.com>
Date Thu, 13 Feb 2014 05:12:53 +1100
Subject Re: Top down Python
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6773.1392228782.18130.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392228782 news.xs4all.nl 2904 [2001:888:2000:d::a6]:59583
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66068

Show key headers only | View raw


On Thu, Feb 13, 2014 at 4:57 AM, Michael Torrie <torriem@gmail.com> wrote:
> It's unclear of what you are really trying to do, though.  Doing as you
> propose to have a python server communicating with a web front-end is
> going to be a lot harder than you think. ...
> Some kind of CGI system. Or roll your own with TCP/IP Sockets. ...

There's a fundamentally tricky part to this, which is that the Python
interpreter is stateful and HTTP is stateless. You can't usefully use
the Python REPL as anything more than a calculator without maintaining
a dedicated process for each connected client... and HTTP doesn't have
a concept of "connected client". (Cookies will let you recognize a
client as the same one who spoke to you earlier, but you'd need some
kind of timeout system to flush out the ones who've gone away. Set the
timeout too short and you annoy everyone until they don't use it; set
it too long and you saturate your server with myriad processes that
aren't needed any more.) So you may have to look into a non-HTTP way
of communicating between the server and the client. At the moment,
there aren't many ways you can do that; you can either plonk down a
non-JS object (eg Flash or Java), or you can use HTML5 WebSockets
(which aren't supported everywhere); either way, you have to worry
about what clients will support it, how it traverses firewalls, etc,
etc.

Oh, and there's another tricky bit. Python isn't secure. Running it on
your server means opening yourself up to all sorts of crazinesses - if
nothing else, you need a way to kill the server process and restart
it, when you get something stuck somewhere (trust me, you will - it
doesn't require malice!). Using a web browser as a UI is fine for some
things (I wrote a command/control system for movie players that works
through a browser), but it's not automatically easy.

ChrisA

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


Thread

Re: Top down Python Chris Angelico <rosuav@gmail.com> - 2014-02-13 05:12 +1100

csiph-web