coding python by web?

Thinkit aoeu at go.com
Thu Jul 11 02:10:22 EDT 2002


Gerhard Häring <gh_pythonlist at gmx.de> wrote in message news:<mailman.1024330042.29469.python-list at python.org>...
> * Thinkit <aoeu at go.com> [2002-06-17 04:17 -0700]:
> > Is there any way to test out simple python code with only a web
> > browser (no input or files, just printing text)?  I'm guessing a
> > simple cgi setup could do this, but has it been implemented anywhere?
> 
> Hi, "Thinkit",
> 
> dunno if it's implemented, yet, but it's not difficult to do. Below I've
> put a quick, working draft, replace exec with print to see the code.
> 
> The trick is to redirect sys.stdout and use exec.
> 
> Things not implemented in the draft:
> - using a restricted environment
> - handling exceptions gracefully, displaying a traceback
> 
> import zlib,base64
> exec(zlib.decompress(base64.decodestring("""
> eNpdUstq3TAQ3esrplMu2HBjh0IpBNubQKCrLLItFNnWdURkSUjjJCbk3zvy49atVvM4OjNnZr5+
> KacYSuM6acpW29LP9Oys0KN3gaAb9BniHHf/iYK2w89HIUiGQRHUgCWDbtLXVnYvvXOh8DMK8Uyj
> SWnEKplN1bp+bgRsr7q4MMLKUuMpW6084gFC6p3DSoKVo6oxdkF7QgjuLdb47Rahc4atH98R3oL0
> Nb7qQJM02JyyFZzHqtxZGvjLrK2fCGj2iXZqR03YVOUSPdQvU49H/z8JPqhrJTcRf071UrQqF80s
> XohFaJ1GWTxoZfonckEOKsvF+pNzCVKw/FdpJpXtQs88vFwIF/TwO1LPFRjKyyhWR7TT5aICx/at
> FLuRuK84BqxIIcZ5MK6VJnLs45PdZe+bJ9S76mDrSVu4gs+wA8W/tIfOtmaKqNRLdstde+6EAO+d
> JWXpJo36DtIqlsn8srhDljs5wQeuF4B321Gw+uNkOb6V4FX2WX5Nc2I1WIH4A+u46F4=
> """)))
> 
> Gerhard

I haven't tried this yet...problem for me is I don't know where I'll
get custom cgi access.  It would be really great if this kind of thing
was available for quick testing of snippets of code in any language.



More information about the Python-list mailing list