How do I print exception while running Python automation tests?

Can I print exception while running Python automation tests?

Hi Ana,

For Python 2.6 and later and Python 3.x:

except Exception as e: print(e)

For Python 2.5 and earlier, use:

except Exception,e: print str(e)