Re: [Tutor] Retriving previous user inputs in a gui

2010-08-25 Thread Alan Gauld
"Karim" wrote Is there any equivalent to JAVACC in python (or lex yacc) to create grammary for config or format file? Thats kind of what ConfiogParser does - it gives you tools to read/write a config file. If you don't mind the data not being human readable you could also use the shelve

Re: [Tutor] Retriving previous user inputs in a gui

2010-08-24 Thread Karim
Thanks Alan for you advice! Our environment is secured because the program is only for internal use. We are supporting electronic designers. Nobody at work will write delete codes inside (I hope). But, sure, I will check configParser module. I wanted a straight forward config file because for TC

Re: [Tutor] Retriving previous user inputs in a gui

2010-08-24 Thread Alan Gauld
"Karim" wrote >>> import params >>> dir(params) ['EntryTextMail', 'EntryTextName', '__builtins__', '__doc__', But the file to import should have '.py' extension (.py) (if there is a way to avoid that I wanted to use a 'hidden' file kind of ".config" , You can exec a file and you can read

Re: [Tutor] Retriving previous user inputs in a gui

2010-08-24 Thread Karim
after tests I get the following: >>> import params >>> dir(params) ['EntryTextMail', 'EntryTextName', '__builtins__', '__doc__', '__file__', '__name__', '__package__'] >>> params.EntryTextName 'myName' >>> params.EntryTextMail 'mym...@gmail.com' But the file to import should have '.py' extens

Re: [Tutor] Retriving previous user inputs in a gui

2010-08-24 Thread Karim
Correction indents disappear (sic !) and lines are inverted (my mistake too) :o): def sourceConfigGui(mySourceFile,path_to_mysourcefile): import sys sys.path.append(path_to_mysourcefile) import mySourceFile Karim On 08/24/2010 09:28 PM, Karim wrote: Ok I find a solut

Re: [Tutor] Retriving previous user inputs in a gui

2010-08-24 Thread Karim
Ok I find a solution (need to test it) that seems correct: Suppose we have a python file mySourceFile with this setting: EntryTextName = "myName" EntryTextMail = "mym...@gmail.com" In the calling script or main python file we could define a function sourceConfigGui as follow: def sourceCo

Re: [Tutor] Retriving previous user inputs in a gui

2010-08-24 Thread Karim
Thank you Alan for your answer. In fact I want to do it in python format. I want to source it (I will declare it each input as a python variable). I don't want to parse it. I just want to source it like an external file in bash for example. Is there a way to not use string evaluation. But really

Re: [Tutor] Retriving previous user inputs in a gui

2010-08-24 Thread Alan Gauld
"Karim" wrote I am figuring this out. I want a sort of file who store values entered previously in a gui. Thats easy enough - have you succeeded with this bit - check the file with a text editor... Th e next time the user launch his gui in the same directory the gui load the previous value

[Tutor] Retriving previous user inputs in a gui

2010-08-24 Thread Karim
Hello All, I am figuring this out. I want a sort of file who store values entered previously in a gui. Th e next time the user launch his gui in the same directory the gui load the previous value from this file. Is there any modules in Tkinter for that? I suppose the file could be in xml form