[Tutor] How to save user data?
acidblue
acidrex at earthlink.net
Thu May 27 17:33:16 EDT 2004
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
Python 2.3
My code thus far:
from wxPython.wx import *
from wxPython.lib.maskededit import Field, wxMaskedTextCtrl
from wxPython.lib.maskededit import autoformats
import datetime
def create(parent):
return Blue49(parent)
[wxID_BLUE49, wxID_BLUE49FLOWERTIMEBOX, wxID_BLUE49PANEL1,
wxID_BLUE49STARTDATEBOX, wxID_BLUE49STARTSEEDSTEXTBOX,
wxID_BLUE49STATICTEXT1,
] = map(lambda _init_ctrls: wxNewId(), range(6))
class Blue49(wxFrame):
def _init_ctrls(self, prnt):
# generated method, don't edit
wxFrame.__init__(self, id=wxID_BLUE49, name='Blue49', parent=prnt,
pos=wxPoint(168, 148), size=wxSize(600, 427),
style=wxDEFAULT_FRAME_STYLE, title='Blue49')
self.SetClientSize(wxSize(592, 393))
self.panel1 = wxPanel(id=wxID_BLUE49PANEL1, name='panel1',
parent=self,
pos=wxPoint(0, 0), size=wxSize(592, 393),
style=wxTAB_TRAVERSAL)
self.StartDateBox = wxMaskedTextCtrl(id=wxID_BLUE49STARTDATEBOX,
name='StartDateBox', parent=self.panel1, pos=wxPoint(192, 48),
size=wxSize(79, 21), style=0, value=' / / ')
self.StartDateBox.SetMask('XX/XX/XXXX')
self.StartDateBox.SetAutoformat('')
self.StartDateBox.SetDatestyle('MDY')
self.StartDateBox.SetFormatcodes('')
self.StartDateBox.SetDescription('')
self.StartDateBox.SetExcludeChars('')
self.StartDateBox.SetValidRegex('')
self.StartSeedsTextbox =
wxStaticText(id=wxID_BLUE49STARTSEEDSTEXTBOX,
label='Enter a date for starting seeds',
name='StartSeedsTextbox',
parent=self.panel1, pos=wxPoint(40, 56), size=wxSize(141, 13),
style=0)
self.FlowerTimebox = wxMaskedTextCtrl(id=wxID_BLUE49FLOWERTIMEBOX,
name='FlowerTimebox', parent=self.panel1, pos=wxPoint(248,
80),
size=wxSize(24, 21), style=0, value='')
self.FlowerTimebox.SetMask('XX')
self.FlowerTimebox.SetAutoformat('')
self.FlowerTimebox.SetDatestyle('MDY')
self.FlowerTimebox.SetFormatcodes('')
self.FlowerTimebox.SetDescription('')
self.FlowerTimebox.SetExcludeChars('')
self.FlowerTimebox.SetValidRegex('')
self.staticText1 = wxStaticText(id=wxID_BLUE49STATICTEXT1,
label='Enter days for flower period.(max-99)',
name='staticText1',
parent=self.panel1, pos=wxPoint(40, 88), size=wxSize(171, 13),
style=0)
def __init__(self, parent):
self._init_ctrls(parent)
More information about the Tutor
mailing list