我在一台Windows 10机器上使用Python3.7.0。
我有一个程序,通过任务调度器每5分钟运行一次,如果满足某些参数(这是一天中的给定时间),我需要用户输入。否则,程序结束。
每隔5分钟,即使不需要用户输入,也会弹出一个python窗口,因为程序是通过python.exe运行的。
为了避免这个问题,有没有一种方法可以通过pythonw.exe运行脚本,并只在需要用户输入时打开终端?
我需要的代码是像下面的sudo-code一样的东西:
if (conditions are met):
open terminal window
run program in termin
我用python编写了一个在循环中工作的小脚本。每隔30秒,它就会得到一个带有requests的url,用来检查页面内容是否发生了变化。
但有时我会遇到脚本错误(大约一天一次):
ConnectionError: HTTPSConnectionPool(host='www.example.com', port=443): Max retries exceeded with url: /test/ (Caused by NewConnectionError(<urllib3.connection.VerifiedHTTPSConnection object at 0x...