Redirecting StdOut

Peter Hansen peter at engcorp.com
Sun Jun 23 21:42:11 EDT 2002


"Ugo García" wrote:
> 
> "Peter Hansen" <peter at engcorp.com> escribió en el mensaje
> > Why would you bother with C for a game that relies on simple print
> > statements for its interface?
> 
> What I'm making is a engine to make Graphical Adventures.
> 
>  Can't you implement the game entirely in Python?
> Probably it would be implemented entirely in Python. Why not? SPEED. I'm
> familiarized with C and prefer to make the core of the engine in C, which is
> faster and more reliable for this kind of things, and leave Python be ONLY
> the script language of the engine.

You'll doubtless get other replies on this, including pointers to PyGame.
I just want to ask a few more questions (yes, all just to make my point...
please forgive me :-).

What makes you think a game implemented in Python will not have
enough speed?  You certainly would not be writing the low level
graphics routines in Python, but then you aren't about to do that
in C, either (I sincerely hope).  Python can call on libraries 
which have already been written *in C* (usually) to do the grunt
work, so it is quite fast enough.

As for reliable, I have to most vigorously object to anyone 
characterizing C as "reliable".  C code is notoriously difficult
to make reliable, generally being strewn with pointer bugs, 
memory allocation problems, and so forth.  C was really written
only as a somewhat more human-readable Assembly language substitute
and has been supplanted by many more suitable alternatives for
something as sophisticated as the engine of a game.

Or to put it another way: don't knock it till you've tried it!
Python is quite possibly a far more suitable solution for
the entire application, not just for the scripting language.

-Peter



More information about the Python-list mailing list