Hi guys,

I'm just trying to access my string from the textbox but my poor understanding of the python structure has made me quite frustrated.

Here's the code:

Qt Code:
  1. import sys
  2. import time
  3. from PyQt4.Qt import *
  4. from PyQt4 import QtGui, QtCore
  5.  
  6.  
  7. def CheckText(self):
  8. print(textbox.self.text)
  9.  
  10. def info(self):
  11. label.setText("Information here")
  12.  
  13. app = QtGui.QApplication(sys.argv)
  14. window = QtGui.QWidget()
  15. window.resize(600,400)
  16. window.setWindowTitle("Test")
  17.  
  18. label = QtGui.QLabel("Status Text", window)
  19. label.move(260,230)
  20. label.resize(500,50)
  21.  
  22. textbox = QLineEdit(window)
  23. textbox.move(30, 45)
  24. textbox.resize(220,30)
  25.  
  26. btn_Enter = QtGui.QPushButton("Enter", window)
  27. btn_Enter.move(30,80)
  28. btn_Enter.resize(150,50)
  29. btn_Enter.clicked.connect(lambda: CheckText(window))
  30.  
  31.  
  32. window.show()
  33.  
  34. sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode 

The reason I'm using the code structure as above is because it allows me to edit the labels much easier but now I can't access the textbox string for comparing purposes. Anybody can help with me out?\


Thanks!
Vizier87