第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

嘗試使用“pyinstaller <scriptname.py>”

嘗試使用“pyinstaller <scriptname.py>”

白衣非少年 2022-06-07 16:36:44
我想通過python創(chuàng)建一個(gè)簡單的是/否消息框作為一個(gè)可執(zhí)行文件。使用 pyqt5 并嘗試使用 pyinstaller.Got 和錯(cuò)誤生成可執(zhí)行文件TypeError: an integer is required (got type bytes).使用命令后pyinstaller <scriptname.py>import sysfrom PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox , QDesktopWidgetfrom PyQt5.QtGui import QIconfrom PyQt5.QtCore import pyqtSlotclass App(QWidget):    def __init__(self):        super().__init__()        self.initUI()    def center(self):        # geometry of the main window        qr = self.frameGeometry()        # center point of screen        cp = QDesktopWidget().availableGeometry().center()        # move rectangle's center point to screen's center point        qr.moveCenter(cp)        # top left of rectangle becomes top left of window centering it        self.move(qr.topLeft())    def initUI(self):        self.center()        buttonReply = QMessageBox.question(self, 'PyQt5 message', "Do you like PyQt5?",                                           QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel, QMessageBox.Cancel)        if buttonReply == QMessageBox.Yes:            print('Yes clicked.')        if buttonReply == QMessageBox.No:            print('No clicked.')        if buttonReply == QMessageBox.Cancel:            print('Cancel')        self.show()if __name__ == '__main__':    app = QApplication(sys.argv)    ex = App()    sys.exit(app.exec_())
查看完整描述

2 回答

?
冉冉說

TA貢獻(xiàn)1877條經(jīng)驗(yàn) 獲得超1個(gè)贊

我在某人的評(píng)論中找到答案。

嘗試使用與 python 3.8 兼容的最新版本。

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

這個(gè)解決方案對(duì)我有用


查看完整回答
反對(duì) 回復(fù) 2022-06-07
?
呼如林

TA貢獻(xiàn)1798條經(jīng)驗(yàn) 獲得超3個(gè)贊

PyInstaller 目前不支持 3.8。我建議您使用 3.7 或更早版本構(gòu)建,直到支持 python 3.8



查看完整回答
反對(duì) 回復(fù) 2022-06-07
  • 2 回答
  • 0 關(guān)注
  • 153 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)