python 获取exception 名字
2021-07-20 19:06
                         标签:inpu   error   indexer   cep   exce   username   变量   style   用不了    username:11 username:1 python 获取exception 名字 标签:inpu   error   indexer   cep   exce   username   变量   style   用不了    原文地址:https://www.cnblogs.com/apollo1616/p/9516879.htmldef func():
    list = []
    usr = input(‘username:‘)
    pwd = input(‘password:‘)
    try:
        list[4] # 这个是调用不了的,因为列表没有元素
    except Exception as e:
        print(e.__class__)
func()
password:1def func():
    list = []
    usr = input(‘username:‘)
    pwd = input(‘password:‘)
    try:
        name # 这个变量是没法收到的
    except Exception as e:
        print(e.__class__)
func()
password:1
下一篇:为什么要设置java环境变量