Your Python, Our Servers : What could possibly go wrong?

We’ve been brainstorming for products to build. What do you think of this one?

Python Interactive Console in the Browser

One idea is a CPython interactive console in the browser. Client is Javascript, which sends the user’s Python to execute in a sandbox on our EC2 instances. Dirigible already has the infrastructure to support running our user’s arbitrary Python in a sandbox across our grid – so we’d only need to strip the spreadsheet-UI off to expose this functionality to end-users.

Python in the browser

Your console state is persistant – so you could start some investigation, or a long-running statement, then log off, and then reconnect to it later from another machine.

Since the Python runs on our servers, all the client needs is a working browser with Javascript. You could run code from any device – even funky things like iPads which don’t traditionally make installing and running Python very easy. Your only hinderance would be the keyboard. Since our servers could be beefy, it would run substantially faster. We could help to support running in parallel across several servers.

We could provide multiple versions of Python – and keep them fully loaded with packages from PyPI – so you could use any combo without having to install anything locally.

There are already some examples of in-browser Python consoles like this, but none of them quite do what we’d hope to do.

We’re also thinking of providing really simple tools so you could work on scripts or programs locally, and then run them in the cloud with a single command / button.

Generally we’re thinking of running your stuff on our own EC2 servers. Other applications might involve executing stuff on your own servers, instead of ours, but thus far we haven’t come up with applications of this that offer much over fabric or a combination of an SSH session and Unix program ‘screen’.

Would you use this? What for? Do you think it’s totally dumb? I’d love to hear about it.

Most interestingly, would you pay for it? We’re thinking free for trivial uses, a few dollars for some advanced features (access to networking, persistance) and scale up to support teraflop computing.

9 thoughts on “Your Python, Our Servers : What could possibly go wrong?

  1. @Jonathan You should definitely talk to Francis Irving (CEO of ScraperWiki now), I can put you in touch if you don’t already know him.

  2. @David. Hey, thanks for that – I hadn’t looked at ScraperWiki at all, I’m sorting through its components now.

    @Sundar. Thanks for the input! You have indeed anticipated some genuine problems. We’re working on providing pretty much exactly what you suggest.

  3. It would be fun. But needs more than just a python shell. You may need to make the code immediately sharable with a fellow developer by integrating something like git with it.

    If you are thinking about Python code running for a long time (that’s when you go for the cloud), it would usually chunk a lot of data. If the database is going to reside somewhere at the users’ own servers, they may very well run Python on those servers, because the network connection and their local server speed are anyway going to bottleneck their performance. So you may need to provide some kind of a database support.

    But if you are just thinking about education purpose for some Python newbie, yes, it’s a good idea.

  4. Hey. Thanks for the comments, people.

    @Rafe: We’d definitely want to include all those things you mention. I’m envisaging we’d load it up with all of the top few hundred PyPI packages, and see no reason we couldn’t just do that on every version of Python. I don’t think we could literally provide [i|b]Python directly, but we aim to emulate behaviour much like that ourselves, in a Javascript client.

    @Terrasque: Heh! We’re really wary of that. We currently run user-supplied code in a chroot jail, which disallows access to networking by default. We’re thinking we’d let users access the network once they’ve signed up with an identified account. Perhaps this means network access is one of the features we ask people to pay for.

    @Ram: Something like the Python turtle would be magnificent! I’ve been talking on twitter about possible ways to provide PyGame or maybe OpenGL access – these with a turtle-like layer on top would be great for adoption and instruction, as you say, and we’re also not sure how to monetize it without moving into providing training courses in a big way. But maybe that’s our word-of-mouth promotion tool?

    @Leonhard. Yeah, we’d really like a way to allow users to create scripts, and separate modules too. Maybe the way to do that is to provide a simple client-end process which gathers up local files and submits them for remote execution? Not sure about this.

  5. Sounds interesting. I would love to be able to use python on ipad, for simple things, euler problems etc. and would probably pay for it if not too expensive.

    Even better if it had also a script, which could be executed similar to Idle and not only console. Would not need own modules, just a main script.

  6. I’d like to see a combination of an online Python shell and PythonTurtle:

    http://pythonturtle.org/

    Letting people learn Python through the browser without making them install anything would really lower the threshold for getting people (especially children) excited about Python.

    But of course, there’s probably not much money to be made doing this.

  7. I might use it. Features that would be nice to coax me and others to become users:

    – ipython or bpython
    – Choice of python versions
    – Some common extensions available (e.g. lxml).

Leave a Reply