try:
xxxxxx
except Exception as e:
# print(e)
print(type(e)) # output:<class 'MySQLdb.ProgrammingError'>
print(e.__class__.__name__) # output:ProgrammingError
请问在这种情景下,如何能获得'MySQLdb.ProgrammingError'完整的字符串?
1
Vegetable 327 天前 1
f"{e.__class__.__module__}.{e.__class__.__name__}"
|