[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] python, games and the web.



campbell barton wrote:
Hi All. I am seriously looking at making a 'program your robot' (ROBOSOCCER) type game in python for a major assignment at school.
While I would love to use pygame, I would like this game to be played over the web, in a browser window without any uncommon plugins.
it will be tough to make the game work 'applet'-y. if you plan to go with straight python and pygame i think you'll really want to create a standalone client, then associate the client with file extension like .PYROBOT or .PYROBOTSERVER. then when a user clicks on whatver links you have for the robots it should be able to automatically open the client in a window or whatever.

your biggest challenge will be a way to run untrusted python code on either the client or server. this is also probably the most difficult problem for creating a 'pygame applet environment'. your best bet might be to stick with python2.1 where the Rexec and Bastion modules were deemed 'pretty good', but far from battle tested. in more recent python's these security modules have been deemed worthless. (apparently new-style classes defeat the security they provided. i believe they are removed from 2.3?) even if you get the code code into a completely sandboxed environment, it is rediculously hard to prevent client code like this, """while 1: pass""". you could try for python threads, but currently python threads have no way to stop a running thread.