gpt4 book ai didi

python - Jython 类型错误 - Maximo 自动化脚本

转载 作者:太空宇宙 更新时间:2023-11-03 17:36:53 24 4
gpt4 key购买 nike

我正在使用下面的脚本来查看“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 新手,所以任何输入都会有帮助

最佳答案

&是Python中的按位与运算符。您应该使用 and 像 -

if ttype != None and ttype != '':

关于python - Jython 类型错误 - Maximo 自动化脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31096713/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com