1

我正在使用下面的脚本来查看“ttype”是否已更改,以便我可以重置“tclass”的值

if ttype != None & ttype != '':
  tclass=None

但是,在应用程序中触发脚本时,我收到以下错误:

TypeError: unsupported operand type(s) for &: 'NoneType' and 'unicode' in <script> at line number 1

我是 python/jython 的新手,所以任何输入都会有所帮助

4

1 回答 1

2

&bitwise andpython中的运算符。你应该使用and像 -

if ttype != None and ttype != '':
于 2015-06-28T06:20:20.823 回答