Reputation:
I was wondering if it is possible to implement a web based game in python. I have searched the internet and cannot seem to find any tutorial or document pointing to this. Any advice will be appreciated..
Upvotes: 2
Views: 11376
Reputation: 76
These are the only ways I know to "directly" code in python for the web :
Pyjamas which is a python to pyjamas compiler. See this asteroid example (buggy on Chrome). I made one myself and simple stuffs are working well but you can't display text on the canvas at the moment. And i guess It would be much slower than pure javascript.
Panda3D and its plugin, so you'll have to ask the players to download that plugin.
Upvotes: 0
Reputation: 5577
Python can be used in a variety of ways for developing web games. In particular, it can be very useful for doing the back-end of a multiplayer game. For the front-end you will probably need to use a client-side technology like Flash, but there have been turn-based games that simply use static HTML as the front-end (for example, Urban Dead) and that could be implemented in Python alone without a separate client-side technology.
Upvotes: 0
Reputation: 2667
Your question is a bit vague but from what I understand you are trying to create a web based game with Python.
As python is a serverside language you could implement the website/server with it but for the client and the game itself you will need a browser based client-side technology. Like Flash, Silverlight, WEBGL or Even Javascript and HTML5. But this will all depend on how you would like to structure your game.
You could create a Server that pushes information to the clients with a library with say Twisted. The other option you could choose is to create a website that the clients will poll for information or use Comet for Push.
Upvotes: 2
Reputation: 7654
Python is a serverside language. For the "web" in web-based you still need HTML und JS (or Flash). Using Python for the serverside is possible. Here is a list of Python web frameworks (my personal favorite is Django).
Upvotes: 0
Reputation: 799520
Of course it is. But without more information on what type of game it is impossible to provide further guidance.
Upvotes: 0