Python declarative

Asaf Las roegltd at gmail.com
Wed Jan 22 16:16:53 EST 2014


On Wednesday, January 15, 2014 7:02:08 PM UTC+2, Sergio Tortosa Benedito wrote:
> Hi I'm developing a sort of language extension for writing GUI programs
> called guilang, right now it's written in Lua but I'm considreing Python
> instead (because it's more tailored to alone applications). My question
> it's if I can achieve this declarative-thing in python. Here's an
> example:
> Window "myWindow" {
> 	title="Hello world";
> 	Button "myButton" {
> 		label="I'm a button";
> 		onClick=exit
> 	}
> }
> print(myWindow.myButton.label)
> Of course it doesn't need to be 100% equal. Thanks in advance
> Sergio

Hi Sergio 

i am novice in python, but let me suggest you something: 
it would be beneficial to use json text file to specify 
your gui so composite data structure can be created using 
json and then your program can construct window giving 
its content will be based on simple text file? 
You can add every parameter to json encoded window system
once your window construction will be using as interpreter 
for that. JSON is very structured and quite presentable for 
such kind of things.

What Gurus do think about this suggestion?

/Asaf



More information about the Python-list mailing list