有没有办法每分钟打印一次?我不确定,我不想搜索它让我感到困惑

Is there a way to print this once every minute? I'm not to sure and I'd rather not search it up to get me confused

我不确定如何每分钟或特定时间限制打印此语句。我想在线搜索它,但我认为 SO 上的人更相关。

我不知道该做什么哈哈

import time
while True:

    print("This prints once a minute.")

    time.sleep

我希望它每秒或每分钟打印一次

快到了

将time.sleep改为

time.sleep(10)

那会睡 10 秒。

您需要在 time.sleep 后添加一个时间值 由于您想每分钟打印一次,而一分钟有 60 秒,

您的代码将是:

time.sleep(60)