Surbao commited on
Commit
5e06f8a
·
verified ·
1 Parent(s): 9320e99

Update print.py

Browse files
Files changed (1) hide show
  1. print.py +2 -4
print.py CHANGED
@@ -12,14 +12,12 @@ def read_and_print_file():
12
  except Exception as e:
13
  print(f"An unexpected error occurred: {e}")
14
 
15
- # 定时运行
16
- interval = 10 # 设置间隔时间(单位:秒),例如 600 秒(10 分钟)
17
-
18
  print("Starting task. Press Ctrl+C to stop.")
19
  try:
20
  while True:
21
  read_and_print_file()
22
- print(f"Sleeping for {interval} seconds...")
23
  time.sleep(interval)
24
  except KeyboardInterrupt:
25
  print("\nTask stopped.")
 
12
  except Exception as e:
13
  print(f"An unexpected error occurred: {e}")
14
 
15
+ # 定时任务,每隔10秒打印一次
16
+ interval = 10 # 设置间隔时间(秒)
 
17
  print("Starting task. Press Ctrl+C to stop.")
18
  try:
19
  while True:
20
  read_and_print_file()
 
21
  time.sleep(interval)
22
  except KeyboardInterrupt:
23
  print("\nTask stopped.")