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

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

使用 pyflakes3 刪除未使用的導(dǎo)入

使用 pyflakes3 刪除未使用的導(dǎo)入

白板的微信 2023-08-15 16:57:04
當(dāng)我跑步時(shí)pyflakes3?tdg.py它向我展示:tdg.py:1: 'PyQt5.QtWidgets.QListWidget' imported but unusedtdg.py:1: 'PyQt5.QtWidgets.QListWidgetItem' imported but unusedtdg.py:1: 'PyQt5.QtWidgets.QAbstractItemView' imported but unusedtdg.py:3: 'PyQt5.QtGui.QIcon' imported but unusedtdg.py:4: 'from PyQt5.QtGui import *' used; unable to detect undefined namestdg.py:5: 'from PyQt5.QtWidgets import *' used; unable to detect undefined namestdg.py:15: 'QGraphicsView' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:21: 'QPainter' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:21: 'QPainter' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:24: 'QPalette' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:26: 'QGraphicsScene' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:29: 'QGraphicsPixmapItem' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:52: 'QtCore' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:54: 'QDialog' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:73: 'QFormLayout' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:104: 'QFrame' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:109: 'QFont' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgetstdg.py:210: local variable 'pixmap' is assigned to but never usedtdg.py:337: 'QMessageBox' may be undefined, or defined from star imports: PyQt5.QtGui, PyQt5.QtWidgets如何在不運(yùn)行代碼的情況下找出可以刪除的內(nèi)容?足夠了pyflakes3還是有更好的工具?
查看完整描述

1 回答

?
12345678_0001

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

QListWidget、QListWidgetItem、QAbstractItemView和QIcon導(dǎo)入可以被刪除。該變量也pixmap可以被刪除,因?yàn)樗皬奈词褂眠^”。


要修復(fù)有關(guān)星號(hào)導(dǎo)入的警告,請(qǐng)顯式定義導(dǎo)入,如下所示:


from PyQt5.QtGui import QPainter, QPalette, QFont

from PyQt5.QtWidgets import QGraphicsScene, QFrame, QGraphicsView, QGraphicsPixmapItem, QDialog, QFormLayout, QMessageBox

from PyQt5 import QtCore

然后刪除明星進(jìn)口。


查看完整回答
反對(duì) 回復(fù) 2023-08-15
  • 1 回答
  • 0 關(guān)注
  • 196 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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