我试图用crontab -e运行cron作业。我使用的是Python代码试图运行crontab
#!/usr/bin/env python
import webbrowser
handle = webbrowser.get()
handle.open_new_tab('http://www.youtube.com/watch?v=Y4QGPWLY-EM')
运行的crontab -ei有:
* * * * * python /home/sean/imBlue.py >>/tmp/out.txt 2>&1
而且我不断收到这些错误消息
Traceback (most recent call last):
File "/home/sean/imBlue.py", line 3, in <module>
handle = webbrowser.get()
File "/usr/lib/python2.7/webbrowser.py", line 52, in get
raise Error("could not locate runnable browser")
webbrowser.Error: could not locate runnable browser
我不知道我需要什么包括我做错了什么。当我在bash中运行脚本时:python scriptName.py 我没有任何问题。此外,我已将文件的设置更改为chmod a + x。
您使用哪个浏览器? – Ofiris
我使用Firefox浏览器 – Sean
'handle = webbrowser.get('firefox')' – Ofiris