[英]Python schedule script running in IDLE but not in Visual Studio Code
以下测试代码可以在Python IDLE中完美运行,但是在Visual Studio Code中,我收到一条错误消息,内容为:
“ AttributeError:'模块'对象没有属性'每个'...”
import schedule
import time
def job(t):
print "I'm working..." , t
return
schedule.every().day.at("08:16").do(job,'hello')
while True:
schedule.run_pending()
time.sleep(60) # wait one minute
我正在尝试安排Python中的重复任务。 我已经安装了schedule模块,并使用代码进行了试用。 清理文件,重命名文件并将其重新写入新文件并没有帮助。
脚本怎么可能在一个应用程序中运行而不在另一个应用程序中运行? 那有意义吗?
任何帮助将不胜感激。 提前致谢。
你可以做:
from schedule import *
import schedule
打印:
print schedule.__file__
另外,请确保您的文件名未命名为:“ schedule.py”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.