pygame, pywebsite -- a website with joystick controls???!??!
Here's a song program written with a pygame style api:
Note this is not in pygame yet, but is just the possible API. So it can't be benchmarked since it doesn't really exist. It's Vapour-ware ™, so only good for making clouds -- not websites.
Compared to the others*1 it has:
less code (measured in LOC, or # of characters) simpler code (no need to write functions or classes). JOYSTICK control
Note: this is a response to this series of posts about a basic REST application written in python.
import pygame
pygame.init()
counts = {}
going = True
while going:
events = pygame.event.get()
for e in events:
if e.type == HTTP:
if e.path.startswith('/song/'):
song_id = e.path[6:]
if e.method == "POST":
counts[song_id] = counts.get(song_id, 0) + 1
e.write(counts[song_id])
elif e.path == "/":
if e.method == "GET":
data = ','.join(['%s=%s' % (k, v) for k, v in counts.iteritems()])
e.write(data)
elif e.method == "DELETE":
counts.clear()
elif e.type in [QUIT, KEYDOWN, JOYBUTTON, MOUSEDOWN]:
going = False
Note this is not in pygame yet, but is just the possible API. So it can't be benchmarked since it doesn't really exist. It's Vapour-ware ™, so only good for making clouds -- not websites.
Compared to the others*1 it has:
Note: this is a response to this series of posts about a basic REST application written in python.
Starting with "Eric Florenzano's deliberately minimalist WSGI application illustrating a bare metal WSGI application with RESTful behaviour has drawn out from other Python web application framework communities a number of useful comparisons"
- Christian Wyglendowski's entry using cherrypy
- Tim Parkin's restish approach
- Grok showing real object persistence by Martijn Faasen.
- A Werkzeug solution also by Tim Parkin.
- Carlos de la Guardia provides a solution via repoze.bfg, which, like Grok, shows how Zope3 technologies can be used.
- Then mike Watkins does the same thing with qp http://mikewatkins.ca/2009/01/18/resty-applications-in-qp/
- this post (self post) where we add Joystick control to a Vapour-ware ™ REST framework.
Comments