非常抱歉,我会注意Python代码格式。以下是按照正确的Python格式修改后的代码示例:
class WindowB(BaseWindow):
def __init__(self):
super().__init__()
self.textEdit_5 = QtWidgets.QTextEdit(parent=self)
# 其他初始化代码...
# 创建保存按钮
self.save_button = QtWidgets.QPushButton("保存", parent=self)
self.save_button.clicked.connect(self.save_user_input)
def start_thread(self, file_type):
# 允许TextEdit_5编辑
self.textEdit_5.setReadOnly(False)
thread = MyThread(file_type, self.File_Path, self, self.textEdit_5)
thread.start()
class MyThread(threading.Thread):
def __init__(self, file_type, file_path, windowB, textEdit_5):
super().__init__()
self.File_Type = file_type
self.File_Path = file_path
self.window = windowB
self.textEdit_5 = textEdit_5
def run(self):
file_path = os.path.join(self.File_Path, file_name)
Exclud_Book = xlrd.open_workbook(file_path)
# 获取用户输入的内容
exclude_rows_input = self.textEdit_5.toPlainText()
if exclude_rows_input:
self.exclude_rows = int(exclude_rows_input)
exclude_cols_input = self.textEdit_5.toPlainText()
if exclude_cols_input:
exclude_cols = int(exclude_cols_input)
# 其他操作...
# 将TextEdit_5重新设置为只读状态
self.textEdit_5.setReadOnly(True)
非常抱歉之前的错误,希望这次能满足你的要求!
以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。 |