首页 > 代码库 > python 2.6 与 2.4 区别

python 2.6 与 2.4 区别

class

要把 class config(): 改成 class config:

except Exception as e

# only works in python 2.4 to 2.7try:    passexcept Exception,e:   print(e)# only works in python 2.6 to 3.3try:    passexcept Exception as e:    print(e)

 2.4 - 3.x 可以用

import systry:    ...except Exception:    t, e = sys.exc_info()[:2]    print(e)

 

 

python 2.6 与 2.4 区别