我有一个文件名为test.py
。While循环终端等待
test3 = 1000000000
test = 0
xtest = True
def enable():
while xtest:
test += 1
if test > test3:
test3 += test3 * 3
和一个名为testit.py
的文件。
import test
test.enable()
当我运行python testit.py我的终端保持未使用状态,我如何避免终端等待?
看起来像你的循环将永远持续下去......但是如果这就是你想要的,你可以运行'python testit.py&'来把在后台工作(取决于你的shell)。 – mgilson
这会吃掉整个CPU。您应该考虑在某处添加睡眠 –
如果您的终端在预期时未返回提示,则说明您有问题。 – Jeremy