level 1
被强煎的蛋蛋D
楼主
我写了一个定时小程序,然后点击运行。我设置了允许后台,电池也设置了白名单。正常点击运行不最小化没有问题。然而点击运行后最小化后有时候可以,有时候不行,是我的操作问题,还是pydroid本身不支持最小化后台运行呢
import schedule
import time
import subprocess
def run_my_script():
subprocess.call(['python', '/storage/emulated/0/ji/集合.py'])
a=["09:00","10:00","12:33","14:00","14:30","14:45","14:50","14:55"]
for i in a:
schedule.every().day.at(i).do(run_my_script)
print("开始定时任务")
while True:
schedule.run_pending()
time.sleep(1)
2023年09月24日 06点09分
1
import schedule
import time
import subprocess
def run_my_script():
subprocess.call(['python', '/storage/emulated/0/ji/集合.py'])
a=["09:00","10:00","12:33","14:00","14:30","14:45","14:50","14:55"]
for i in a:
schedule.every().day.at(i).do(run_my_script)
print("开始定时任务")
while True:
schedule.run_pending()
time.sleep(1)