简体   繁体   中英

Pyside retrieving a user input from QLineEdit

I have a QLineEdit object which I use to retrieve the user input. I am doing .text() to get the text. However it returns me something like <built-in method text of Pyside... object at..>

I just want to get the string inside the Line Edit box. Just to be clear, I am also doing that when a button is pressed. So I write something and then press the button. I even tried using selectAll() , but it just gives me None every time.

targetText = self.targetTextBox.text()
print str(targetText)

I got the mistake I was doing. i was doing print str(targetText). I tried it with just print targetText and it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM