[Tutor] Re: How to save user data?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sun May 30 20:10:54 EDT 2004



On Fri, 28 May 2004, Andrei wrote:

> acidblue <acidrex <at> earthlink.net> writes:
>
> > I have a textctrl box for usr input, do I use raw_input and assign a
> > variable in order to save the information?
> > Using wxPython2.4
>
> You don't use raw_input if you use wxPython. raw_input is for command line
> (console) applications, while the whole point of wxPython is *not* to have a
> console application :). You should use some kind of wxTextCtrl and use its
> GetValue method to get the user's input in that text control. E.g.:
>
>   username = MyTextCtrl.GetValue()
>
> You can then do with that input whatever you like, including saving it.

Hi Acidblue,

You can save certain values in your program by using something like the
'shelve' library:

    http://www.python.org/doc/lib/module-shelve.html

If you have more questions, please feel free to ask.  Good luck!





More information about the Tutor mailing list