Код: Выделить всё
$ python3 report.py --regions ap-southeast-2 --file file.csv
File "report.py", line 51
except Exception, e:
^
SyntaxError: invalid syntax
Я пытался использовать синтаксис Python3, который, по моему мнению, должен был бы переключиться.
Код: Выделить всё
try:
f = file(filepath, 'wt')
except Exception, e:
f = None
sys.stderr.write ('Could not open file %s. reason: %s\n' % (filepath, e))
Код: Выделить всё
try:
f = file(filepath, 'wt')
except:
f = None
sys.stderr.write ('Could not open file %s. reason: %s\n' % (filepath, e))
Мобильная версия