【发布时间】:2021-06-09 22:12:39
【问题描述】:
我的问题是我使用 Visual Studio 代码编写 python 程序, 但我无法将其他模块类(Ui_Form)导入当前模块
这是我当前的模块:
from PyQt5.QtWidgets import *
from HR_System.view.main_window import Ui_Form
class MainWindow(QWidget,Ui_Form):
def __init__(self):
QWidget.__init__(self)
self.setupUi(self)
app = QApplication([])
window=QWidget()
window.show()
app.exec()
原模块(路径:HR_System.view.main_window):
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(1024, 700)
font = QtGui.QFont()
font.setFamily("Terminal")
json 启动:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-msedge",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
为什么没有模块??我使用 python 3.8.6
【问题讨论】:
-
你能发布关于你项目的文件夹结构和错误的截图吗?
-
我添加了 2 张截图,你可以检查一下吗
标签: python class visual-studio-code import