Python:除OSError外,e: [英] Python : except OSError, e:

查看:89
本文介绍了Python:除OSError外,e:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用SST开发一个网站-Web测试框架(我是初学者),但是python有问题

I'm currently developing a website with the SST - Web Test Framework (i'm very beginner) but I have a problem with python

我使用了此链接: https://pypi.python.org/pypi/sst/0.2.2

我正在使用-Python 3.6.4和SST-Web测试框架-最新版本:0.2.4

I m using - Python 3.6.4 and SST - Web Test Framework- Latest Version: 0.2.4

我的代码是:

from sst.actions import *
go_to('http://www.google.com/')

错误是:

C:\Python\scrapy-master\Projects>python proxyhar.py
Traceback (most recent call last):
File "proxyhar.py", line 1, in <module>
from sst.actions import *
File "C:\Python\lib\site-packages\sst\actions.py", line 274, in <module>
except OSError, e:
              ^
SyntaxError: invalid syntax

任何人都建议我如何解决这个问题.

Anyone suggest me how to resolve this.

谢谢

推荐答案

Python 3更改了该表达式的编写方式. 从文档起,现在是except OSError as e

Python 3 has changed how this expression should be written. From the documentation, it is now except OSError as e.

请注意,在Python 2中,逗号和被允许.

Note that in Python 2, both comma and as were permitted.

这篇关于Python:除OSError外,e:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆