[英]How can i display results from a mysql query into Qradiobuttons in python
Im doing a quiz for my coursework and im dont know how to display results of my msql query as a radio button. 我正在为自己的课程做测验,但我不知道如何将我的msql查询结果显示为单选按钮。 I know how to display my results within python traceback but nothing else.
我知道如何在python追溯中显示我的结果,但仅此而已。 Im using pyqt and mysql to code but im dont know how to to display within a label and or a radio button.
我使用pyqt和mysql进行编码,但是我不知道如何在标签和/或单选按钮中显示。 Heres the code which displays the results of the mysql query in python traceback.
这是在python跟踪中显示mysql查询结果的代码。
def Showquestions(self):
mycursor.execute("SELECT*FROM questiontable")
mylist=mycursor.fetchall()
for x in mylist:
print(x)
Can't you just put the query results inside a set of variables and use them in your radiobuttons ? 您不能只是将查询结果放入一组变量中并在单选按钮中使用它们吗?
Besides SELECT * is bad practice. 除了SELECT *之外,这也是不好的做法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.