Is it possible to write games with python… Smooth running games… for the web?

hmm… python can do pretty interesting stuff… and I do know this dude who programs in python… Ill ask him.

here is what my friend wrote in reponse to the python question:

as for web-based games in python, i haven’t seen anything like that on the the net. general consensus is that python just isn’t meant for that. you could probably get the browser to feed the script to a python interpreter, and If and Only If they had every package they needed installed, it’d run (aka pygame)… but it would be a REALLY bad idea to go to a site that had runnable python scripts… and that’s only because python gives the script full access to the filesystem without any security. that’s why macromedia has a proprietary format, they (as a company) promise not to give malicious script kiddies access to anything outside of a very small spot of your hard drive. short answer: i don’t think you can (yet.) i wish!

an alternative though is to use pygame (i think i already set you up with this, and tie in the Twysted libraries. it’d be quite a bit more work, because you’d need to write a client and a server program that communicated by opening a socket. if you were REALLY ambitious, you could write a really spectacular client that doubled as a server, or even a client that simply registered with a web site you put in place and then could communicate with every other client that was connected at the time. DO NOT expect to get a very high framerate out of pygame if you’re doing a lot of network traffic, though – that’s best used for turn-based stuff. people devote years of their life to making the networking code for online first-person shooters (and other such high-action games), and quite often they’re not willing to share. AND that stuff’s usually written in C++ to make the performance all it can be.

or you could make a “thin” client (meaning that the server does most of the work, and the client just shows you what’s happening on the server) that connects to a “fat” server, like some people do with PHP, ASP, JSP, etc. you see that a lot with non-graphical space colonization sims and such. pages of reports of different stats, with various options that count as actions. a different type of game style, it also requires a database server to store all of the information, and an application server to translate the dynamic web pages and render them as HTML. you could do that with Twisted, actually fairly easily, but you’d also need PyMySQL (the python connector) and MySQL (the database). advanced stuff.

Python’s pretty awesome, but it’s not for the web. Pity more hosts don’t support PSP (Python Server Pages, a bit like PHP but with Python), as it makes an ideal server-side language :frowning:

it definetly does look interesting