"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
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
"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
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
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
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
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
"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
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