Re: Pythonic gui format?
bruno at modulix wrote:[color=blue]
> Fuzzyman wrote:
> (snip)
>[color=green]
> > You say you don't want an 'extra layer' between your GUI and Python -
> > but your approach of using XML has the same drawback. Storing your 'GUI
> > configuration' in a text based format is a nice idea, but you will need
> > *something* to do the translation.[/color]
>
> Well, if the conf is valid Python, you've already get most of the
> 'something to do the translation' for free !-)
>[/color]
Except he can't use ordinary dictionaries because they don't preserve
order, which is one of his requirements...
Your trivial example below redone with ConfigObj syntax :
[window]
widgets = , # empty list
Code to read it :
from configobj import ConfigObj
gui_object = ConfigObj(filen ame)
All thebest,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
[color=blue]
>
> --
> bruno desthuilliers
> python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
> p in 'onurb@xiludom. gro'.split('@')])"[/color]
bruno at modulix wrote:[color=blue]
> Fuzzyman wrote:
> (snip)
>[color=green]
> > You say you don't want an 'extra layer' between your GUI and Python -
> > but your approach of using XML has the same drawback. Storing your 'GUI
> > configuration' in a text based format is a nice idea, but you will need
> > *something* to do the translation.[/color]
>
> Well, if the conf is valid Python, you've already get most of the
> 'something to do the translation' for free !-)
>[/color]
Except he can't use ordinary dictionaries because they don't preserve
order, which is one of his requirements...
Your trivial example below redone with ConfigObj syntax :
[window]
widgets = , # empty list
Code to read it :
from configobj import ConfigObj
gui_object = ConfigObj(filen ame)
All thebest,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
[color=blue]
>
> --
> bruno desthuilliers
> python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
> p in 'onurb@xiludom. gro'.split('@')])"[/color]
Comment