我的while循环在运行时不会打印任何内容.
import os
import time
place = 10
running = True
def Write():
j = 1
for i in range(place - 1):
print("-", end = "")
j += 1
print("a", end = "")
for k in range(10 - j):
print("-", end = "")
while running:
Write()
time.sleep(5)
if place > 1:
place -= 1
os.system("clear")
当只有输出和时间的时候.睡眠,while循环工作.
while running:
print("Looping...")
time.sleep(5)
当有功能和时间的时候.睡吧,代码不起作用.
while running:
Write()
time.sleep(5)
请告诉我怎么解决这个问题.