alive_progress 栏在 PyCharm 上不起作用
我正在尝试在 PyCharm 上使用 alive_progress alive_bar 但它仅在整个过程完成后出现在控制台中已经完成了。相反,我希望它随着 for 循环的运行而显示并进展。
玩具示例:
from alive_progress import alive_bar
import time
bar_l = 100
with alive_bar(bar_l) as bar:
for i in range(bar_l):
time.sleep(0.001)
bar()
还有其他人遇到过这个问题吗?
I am trying to use the alive_progress alive_bar on PyCharm but it only appears in the console once the whole process has finished. Instead, I want it to display and progress as the for loop operates.
Toy example:
from alive_progress import alive_bar
import time
bar_l = 100
with alive_bar(bar_l) as bar:
for i in range(bar_l):
time.sleep(0.001)
bar()
Has anyone else encountered this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个选项可以强制启用它并在 PyCharm 中查看活动进度。这是“force_tty=True”
There is a option to force enable it and see alive-progress in PyCharm. It's "force_tty=True"
官方文档,即
alive_progress
的GitHub存储库,提到由于PyCharm的默认设置,alive_bar
在PyCharm的控制台中无法正常工作。要更改此设置,请按照 https://github.com/rsalmei/alive-progress/blob/main/README.md#forcing-animations-on-pycharm-jupyter-etcOfficial documentation, i.e.,
alive_progress
's GitHub repository, mentions that due to PyCharm's default settings,alive_bar
is not working properly in PyCharm's console. To change that, please follow the instructions at https://github.com/rsalmei/alive-progress/blob/main/README.md#forcing-animations-on-pycharm-jupyter-etc