It's inspired by sites like the Groovy Web Console and TryPython. Since I teach a Python programming class, I wanted to create an application for my students to experiment and share scripts they write.
Ironically, the site is written using Java (not Python) for Google AppEngine. The reason for this is, I've been told it's a bit tricky to sandbox Python code, whereas I know it's fairly straightforward in Java. So Jython takes the reins as script interpreter while preventing interpreted code from affecting the application. You can find the entire project on GitHub.
- Evaluate and publish Python code
- Atom feeds for published scripts, optionally filtered by tag
- Edit, run, and comment on others' published scripts.
- REST-like design, using YUI2 and Ojay on the client-side.
Some Technical NotesPython makes for much cleaner code, especially when it comes to templating. I would have preferred to write the application using Gaelyk, but using Groovy to run Jython to interpret Python would have made the irony meter explode. I still think I prefer plain JSP to JSF, although I agree with Matt Raible's sentiment that EL output should be escaped by default. I wrote a couple EL functions to take some of the pain out of JSP, although as a templating framework JSP still has a few significant drawbacks. (Which would explain why nobody uses JSP anymore).
I'd also consider using a proper REST framework (and real JSON library and probably FreeMarker for HTML templating) if the app became anymore complex. Spring's REST support looks good, and with Spring I get DI, scoping and easier configuration too. Again, if my web.xml file got anymore complex, I'd want to move to a more sophisticated solution. I also need to see if I can practically add memcache support, both for markup output and maybe script caching as well.