问题描述
我正在使用 spyder。
当我使用 QRandomGenerator.global()
方法运行我的代码时,会抛出错误。
因为 global
是预先确定的名称。
from PySide2 import QtCore
import PySide2
import os,sys
dirname = os.path.dirname(PySide2.__file__)
plugin_path = os.path.join(dirname,'plugins','platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path
def main():
app = QtCore.QCoreApplication(sys.argv) if QtCore.QCoreApplication.instance() is None else QtCore.QCoreApplication.instance()
r = QtCore.QRandomGenerator.global()
sys.exit(app.exec_())
if __name__ == "__main__":
main()
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)