关于selectone()函数返回值为None时对变量的判断

比如我这里使用selectone()查询后返回值为res=None,然后return到app.py,在函数中进行判断,使用:

if res is None:
否则会报错

TypeError: 'NoneType' object is not subscriptable

或者其他类似的错误。

新手上路,改了半天,记录一下

原文地址:https://www.cnblogs.com/zhangxinyue/p/14839560.html