wxPython: How to Save/Store/Capture/Return user input text.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ekasII
    New Member
    • Jul 2009
    • 16

    wxPython: How to Save/Store/Capture/Return user input text.

    I'm trying to capture text input by user to file,
    Code:
    password = wx.TextCtrl(self.panel_1,wx.ID_ANY,pos=(230,150),size=(200,20),style= wx.TE_PASSWORD)
    l__password_file = <path\file.txt>
    l__get_password = password.GetLineText(1)
    l__write_password = open(l__password_file,'w').write(l__get_password)
    Somehow, GetLineText(1) does not capture the user input, it is suppose to return text on line 1, which must be the user input password, but it does not return anything, how can i capture input text?
    Last edited by bvdet; Aug 24 '09, 06:28 PM. Reason: Add code tags
  • Hackworth
    New Member
    • Aug 2009
    • 13

    #2
    You should be able to use:
    Code:
    l__get_password = password.GetValue()
    Here's a link to the docs for wx.TextCtrl.Get Value()
    Hope this helps!
    Last edited by Hackworth; Aug 26 '09, 04:37 PM. Reason: Added doc link.

    Comment

    • ekasII
      New Member
      • Jul 2009
      • 16

      #3
      I used event.GetString () in a function with the self.Bind(EVT_T EXT,<function>, <wxText_paramet ers>). Thanks anyway for the reply.

      Comment

      Working...