|
From: Maurits v. R. <ma...@va...> - 2003-11-28 15:50:42
|
Reinout van Rees wrote: > [emp] > player=8 > master=~/pl/Memp > [delfshaven] > player=4 > master=kdjlkskdf > > win.ini style or so. Let's just see what python (and C) likes and use > a standard format. There's bound to be a standard format that allows > such section-like things. I didn't like your format because the > headers looked similar to the options, that's why. I committed something. You can now put the config for your games in statsgen.rc. I added a configreader.py to parse that. Result: you can now do: python myplanets.py gamename I can probably add an output=blahblah option so that python puts its output directly into a file instead of printing it to the screen. The config reader is pretty tolerant with regards to whitespace and dos/linux end-of-lines. Everything that is not recognized as the [gamename] that we are looking for or one of the config options for that gamename, is ignored. The #comment lines then don't really need the "#", but let's stick to that. python configreader.py prints the info on "delfshaven" that it can find in statsgen.rc. Good for testing. -- Maurits van Rees | ma...@va... http://maurits.vanrees.org/ "Peace is not the absence of war; it is the absence of fear." |