如何“回车”同时有两条或多条线?
print("Z1: ",zeta_1_time," Z2: ",zeta_2_time," Z3",zeta_3_time,end="\r")
print()
print("GAMMA: ",gamma_time, end="\r")
正如您从上面的代码中看到的,我无法让回车 \r 正常工作。我需要 ZETA 时间和 GAMMA 时间在同一 while 循环内在自己的线路上“更新”。然而,这是我得到的回报。
输出:
Z1: 9 Z2: 6 Z3: 3
Z1: 0 Z2: 0 Z3: 0
GAMMA: 0
while 循环越长,ZETA 创建的行越多。有什么建议吗?
输出应保持如下所示:
Z1: 9 Z2: 6 Z3: 3
GAMMA: 0
print("Z1: ",zeta_1_time," Z2: ",zeta_2_time," Z3",zeta_3_time,end="\r")
print()
print("GAMMA: ",gamma_time, end="\r")
As you can see from code above, I am having trouble getting carriage \r to function properly. I need both the ZETA times and the GAMMA times to be "updating" on their own line, within the same while loop. However, this is the output I am getting in return.
OUTPUT:
Z1: 9 Z2: 6 Z3: 3
Z1: 0 Z2: 0 Z3: 0
GAMMA: 0
The longer the while loop, the more lines ZETA creates. Any suggestions?
The output should stay looking like this:
Z1: 9 Z2: 6 Z3: 3
GAMMA: 0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论