python - Formatting text inside PYQT4? -


userpassword = user_input password = qtgui.qlabel('{}', self).format(userpassword) 

i want label have text inside has been entered user? error below

attributeerror: 'qlabel' object has no attribute 'format' 

the syntax format function str.format()

(python docs str.format())

so code should since want format string(i.e. '{}') , not qlabel object:

userpassword = user_input password = qtgui.qlabel('{}'.format(userpassword), self) 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -