[Tutor] Retriving previous user inputs in a gui

Karim karim.liateni at free.fr
Tue Aug 24 20:21:24 CEST 2010


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 load it
  as python setting file inside python program.

PS: ConfigParser, hum very good , this could be of use for other part...

Karim

On 08/24/2010 08:03 PM, Alan Gauld wrote:
> "Karim" <karim.liateni at free.fr> 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 from this file.
>
> Again thats pretty easy, did you get this working - create the file
> with a text editior?
>
>> Is there any modules in Tkinter for that?
>
> No, Tkinter is for building GUIs. Python core language includes
> functions for reading and writing to files. Can you do this outside a 
> GUI?
>
> Write a program to read the users name and save it to a file.
> Write a program to read the file and print the name it finds.
> Write a program that says Hello <name> if it finds a name and asks for 
> a name if it doesn't.
>
> Now translate that to your GUI.
>
>> suppose the file could
>> be in xml format or whatever?
>
> Yes, it could be in whatever. CSV, XML, ConfigParser or even plain text.
>
> HTH,
>



More information about the Tutor mailing list