python操作系统启动中_Python操作系统启动文件停止在ubuntus中工作

我有一个小脚本,每天由cron运行,已经工作了3个月。在

9月30日,它停止工作,出现以下错误:File "NumberChecker.py", line 32, in start_server

os.startfile(startfile[0])

AttributeError: 'module' object has no attribute 'startfile'

以下是该位的代码:def start_server(xml):

startfile = xml.xpath('/config/files/startfile/text()')

try:

driver = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.HTMLUNIT)

driver.get('http://www.google.com')

except:

print('no server')

server_status = 'down'

os.startfile(startfile[0])

while server_status == 'down':

try :

driver = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.HTMLUNIT)

driver.get('http://www.google.com')

server_status = 'running'

except :

pass

它只是通过请求google来测试selenium服务器是否启动,如果没有,则调用启动它的bash脚本。在

为什么会呢操作系统启动文件突然停止工作?在

我试过在命令行执行以下操作:

^{pr2}$

我得到了File "< stdin >", line 1, in

AttributeError: 'module' object has no attribute 'startfile'

我就是搞不懂它为什么停了?在

它是一个虚拟环境中的Python3.3,操作系统是UbuntuServer12.04

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值