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 2023-10-31 19:48:27 +08:00 1
f"{e.__class__.__module__}.{e.__class__.__name__}"
|