这个问题非常基本,我很尴尬地问它。然而,我在网上或在我的python书中找到答案时遇到了麻烦,我希望我已经措辞好并标记了这个问题,以便其他人可以从答案中受益。
在python中,try-catch块看起来像这样:
try:
do_Some_Stuff()
except ExceptionType as e:
# Handle the error
我遇到了一些似乎有逗号而不是'as'的代码。这是一回事吗?
try:
do_Some_Stuff()
except ExceptionType, e: # <-- comma(',') instead of 'as' here
# Handle the error
提前感谢不让我觉得太傻了!