Problems with Python

Feb 10, 2007 23:45

PreScript: I'm talking about using Python here since that's what I need to write in to mod Civ4 ( Read more... )

civ4, python, geeky

Leave a comment

Comments 5

n5red February 11 2007, 16:29:23 UTC
It's a pity they didn't use Ruby. Maybe you could write a code generator in Ruby to generate the Python code you want.

Reply


fieryfae469 February 11 2007, 21:05:14 UTC
awww. *pats you sweetly as I finger your silk shirt*

I don't understand much of this but, I'll sit quietly with you while you work out the problems and maybe we can talk awhile.

*smile*

Reply


dancinglights February 12 2007, 03:08:50 UTC
Definitely pressed for time.

And I have the same problem reading through Python, especially when looking for bugs. My inner C programmer keeps not seeing }s and thinking that maybe I didn't terminate some block where I meant to and that must obviously be the problem...

Reply


andrewducker February 12 2007, 12:32:06 UTC
I thought the use of whitespace in Python was inspired, but I've never had to actually use it, so I don't know if I'd actually be able to get to grips with it...

Reply


skydancer February 22 2007, 17:02:21 UTC
Re: XML...

They are likely using a validating DOM parser. The parser will either provide the loaded XML as an object model, fully formed, or it will fail. This is certainly the easiest way to load XML, though it is also the most memory-hoggish manner and you can't really try to do error recovery.

At minimum, it will enforce correct XML structure. At the other end, it could be extremely detailed if there is a DTD associated with it--and they could associate one at runtime even if there isn't one specified in the XML file. It's one quick way of doing wholesale validation without having to manually check the data for consistency.

Reply


Leave a comment

Up