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

[pygame] data files with python syntax



plus, when hand-editing, they're nicely syntax-highlighted for you, which
can help you immediately find little mistakes.

I've done my level data files and my animation data files this way.  I
guess it's sort of a declarative programming approach.

-sjbrown

> On 7/18/05, kschnee@xxxxxxxxxx <kschnee@xxxxxxxxxx> wrote:
> > Why not store the room data more simply in a text format, or XML, or
> > Pickle? No need to worry about building a mini-compiler into your program,
> > and depending on your format it may be much more space-efficient and
> > easier to edit with a custom "room editor" program.
>
> Using plain Python syntax for data is very convenient and has lots of
> good points. And you don't need to implement the parser and compiler
> yourself, they come included in Python. Some sort of pickle might be
> nice if you need to edit the files in a custom editor, but for
> hand-editing, the Python syntax is probably close to the nicest thing
> you can get.