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

Re: [pygame] Python, pygame and web integration



> I'm a big newbie (anijap@zapo.net, for some reason my email there stopped
> working so I'm writing from here) and I was curious if you can integrate
> python into webpages, is it even possible or would it be just too
> slow?... like you can integrate php, asp, etc.

Python does support server-side web scripting (I think that's what you're 
asking about?).  There are several ways to accomplish this:

1) You can do low-level CGI stuff with the cgi module included in the 
Python standard library.  This will work but is somewhat low-level and 
involved.

2) You can use the mod_python Apache module, which will give you speed 
advantages and allow you to write less code.  In addition, it provides 
modules for interfacing with the Apache web server.

3) You can use Zope.  Zope is an object-oriented web application framework 
made by the Zope Corporation.  Zope is written entirely in Python, and 
provides lots of free modules and toolkits you can use in your pages.  
However, Zope is slower than mod_python+Apache, and the code you would 
write for Zope is substantially different from the code you would write in 
the other two methods.

However, in none of these cases would the Pygame toolkit actually help 
you, since Pygame is a set of SDL bindings for Python (which is similar to 
something like DirectX on Windows), whereas the type of games you want to 
create don't need client-side graphics buffers or sound support or 
anything like that.

Nat