擅长:python、mysql、java
<p>@Veedrac这不是正确的方法。
正确的方法是使用<code>time.sleep()</code>,它在python3.x和2.x中都能工作。
使用下面的代码来执行此操作。在</p>
<pre><code>import time # Should be the first statement.
# Some code is below. This code is useless.
print()
def blah():
print('bhahfdjfdk')
blah()
# When the program ends, use the code below to keep it running for some more time.
time.sleep(2) # In the parentheses you can replace 2 with the number of seconds you want to put the program on hold. This will help you and is the official Python way.
</code></pre>