[英]python delayed execution of print command?
In some part of my python program , I need to do this - 在我的python程序的某些部分,我需要这样做-
(All this is in a loop) (所有这些都是循环的)
Now the problem is, although command '1.' 现在的问题是,尽管命令为“ 1”。 is executed before '2.' 在“ 2”之前执行。 , '3.' ,“ 3”。 and '4.', it actually displays the message of command '1.' 和“ 4”,它实际上显示命令“ 1”的消息。 on the screen after all 4 commands have been executed, (along with the message of command '4.'). 在执行完所有4条命令后(在屏幕上显示命令4)。 What I want is that it should display the message of command '1.' 我想要的是它应该显示命令“ 1”的消息。 first, then start with the remaining piece of code... How can I make this happen? 首先,然后从剩下的代码开始……如何实现这一目标? (Is there something like flushing for the print command as well?) (是否也有类似冲刷打印命令的内容?)
这可能是您在寻找的内容。 如何刷新Python打印输出?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.