我尝试从一个字段中获取文本,并通过Execute Python Code将其设置为另一个字段。
recs = record.smt
for rec in recs:
details = pythonwhois.get_whois(rec)
if 'No match for' in str(details):
record.smt2='ok'
else:
record.smt2='denied'
错误:禁止操作码
请帮忙!
对于线:
details = pythonwhois.get_whois(rec)
您正在使用未导入的外部库pythonwhois
,您如何在执行中使用它。由于import
语句也是不允许的,因此您不能只导入任何库。
而不是使用点运算符,尝试使用write
函数。
if 'No match for' in str(details):
smt2='ok'
else:
smt2='denied'
record.write({'smt2': smt})
还要记住,record
是触发动作的记录;可能无效