Results 1 to 7 of 7

Thread: While loop problem in pyqt

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Posts
    10
    Thanks
    1

    Default While loop problem in pyqt

    I am new here, so I hope it is not a wrong place to ask for pyqt.

    I wrote a while loop in pyqt but I want it to stop to take input from user.I do this in python with raw_input but it doesn't work in pyqt.How can I do this in pyqt.

    Qt Code:
    1. cev = str(ui.lineEdit.text()).lower()
    2.  
    3. guess = 0
    4. f = 0
    5.  
    6. while cev != answer:
    7. guess += 1
    8.  
    9. ui.label_6.setText(QtGui.QApplication.translate("MainWindow", "Wrong answer!", None, QtGui.QApplication.UnicodeUTF8))
    10.  
    11. f += 1
    12.  
    13. ui.label_4.setText(answer[0:f])
    14.  
    15. if answer[0:f] == answer[0:]:
    16. ui.label_4.setText(answer[0:f])
    17. ui.label_6.setText(QtGui.QApplication.translate("MainWindow"," Answer is revealed", None, QtGui.QApplication.UnicodeUTF8))
    18.  
    19. ui.label_9.setText(QtGui.QApplication.translate("MainWindow", soz[sor1], None, QtGui.QApplication.UnicodeUTF8))
    20. liste.pop(s)
    21. return self.sor()
    22. HERE ?
    23. "cev = raw_input("..................:")"
    To copy to clipboard, switch view to plain text mode 

    I need a code here to take input from user like "raw_input"
    Last edited by neverlander; 16th December 2007 at 15:46.

Similar Threads

  1. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55
  2. Replies: 16
    Last Post: 7th March 2006, 15:57
  3. While statement inside the main loop
    By OnionRingOfDoom in forum Qt Programming
    Replies: 4
    Last Post: 8th February 2006, 18:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.