Python Dearpygui状态框未正确更新
我使用dearpygui作为Web垃圾处理工具的接口。我有一个“状态框”,我想用它向用户传递消息。它被设置为只读、多行输入文本框,用于使用旧值进行更新并附加新消息。如果我运行该程序,它将工作,但状态框的更新不会显示,直到webscraping(下载报告功能)完成。gui不会在每次调用update_status函数时更新。在调用时而不是在整个过程完成时更新和显示此文件的最佳方法是什么Python Dearpygui状态框未正确更新,python,user-interface,Python,User Interface,我使用dearpygui作为Web垃圾处理工具的接口。我有一个“状态框”,我想用它向用户传递消息。它被设置为只读、多行输入文本框,用于使用旧值进行更新并附加新消息。如果我运行该程序,它将工作,但状态框的更新不会显示,直到webscraping(下载报告功能)完成。gui不会在每次调用update_status函数时更新。在调用时而不是在整个过程完成时更新和显示此文件的最佳方法是什么 def window_month_end_reports(sender, data): with wind
def window_month_end_reports(sender, data):
with window('Month End'):
for building in buildings:
add_checkbox(building)
add_spacing()
add_button("Done", callback=run_month_end_reports)
add_spacing()
add_separator()
add_text("Select reports")
for report in reports_list:
add_checkbox(report)
def run_month_end_reports(sender, data):
item_list = []
building_list = []
delete_item('Month End')
for item in reports_list: # LIST OF REPORTS SELECTED
if get_value(item):
item_list.append(item)
for building in buildings:
if get_value(building):
building_list.append(building)
update_status('Running month end reports')
download_reports(building_list, item_list)
def update_status(message):
set_value('##status box', get_value('##status box') + str(message) + '\n')
with window("Main Window"):
add_button("Month End Reports", callback=window_month_end_reports)
add_text("Status Box:")
add_input_text("##status box", readonly=True, multiline=True, height=500)
start_dearpygui(primary_window="Main Window")
解决这个问题的最佳方法可能是使用异步任务来完成下载报告功能。您可以使用run\u async\u函数启动下载。您可以在文档中找到一个长任务管理的示例:解决此问题的最佳方法可能是使用异步任务来完成下载报告功能。您可以使用run\u async\u函数启动下载。您可以在文档中找到长任务管理的示例: