Pysimplegui:当达到MAX_VALUE时,如何保持进度表的打开?
来自Pysimplegui的简单进度表用于通过文件列表运行:
sg_gui.OneLineProgressMeter("Actual:", act_number, total_number, '_M_', actual_Filename)
如何保持窗口打开,在达到MAX_VALUE = total_number之后?
更多的外观:我的问题是,处理最后一个文件时窗口不会保持打开状态,但对于第一个文件来说绝对可以。这是我的代码:
import time
file_count = 1
for scan_file in scan_files:
analyze_file = scan_file.name
mod_gui.OneLineProgressMeter("Actual File:", file_count, files_count, '_M_', analyze_file)
result_file = analyze(analyze_dir, analyze_file)
time.sleep(2)
file_count += 1
我有两个要处理的文件:
- 第一个文件具有
file_count = 1
,仪表可见。 - 最终确定此之后,
file_count
上升= 2,仪表消失了。
可能是,我需要从第二行中的file_count = 0
开始?
A simple ProgressMeter from PySimpleGui is used to run through a list of files:
sg_gui.OneLineProgressMeter("Actual:", act_number, total_number, '_M_', actual_Filename)
How to keep the window open, after max_value = total_number is reached?
MORE EXPLANTION: My problem is that the window does not stay open when the last file is processed but it's absolutely fine for the first ones; this is my code:
import time
file_count = 1
for scan_file in scan_files:
analyze_file = scan_file.name
mod_gui.OneLineProgressMeter("Actual File:", file_count, files_count, '_M_', analyze_file)
result_file = analyze(analyze_dir, analyze_file)
time.sleep(2)
file_count += 1
I have two files for processing:
- The first one has
file_count = 1
, meter is visible. - After this is finalized,
file_count
raises = 2, meter disappears.
May be, I need to start with file_count = 0
in the second line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果
Currence> Current_value> = Max_value
,One_line_progress_meter
的窗口将被关闭。也许您可以构建进度表窗口,如果您有特殊要求,请自己确定并自行更新,请在必要时通过方法删除它。由文本元素模拟的简单进度仪表。
The window for
one_line_progress_meter
will be closed ifcurrent_value >= max_value
. Maybe you can build the progress meter window, finalize and update it by yourself if you have special requirement, delete it by method close when necessary.A simple progress meter simulated by Text element.