因此,我尝试将X从test()传递到rfid()以进行测试,但它不起作用:
这就是我所拥有的:
def test(x):
testcard = 8974
x=testcard
return x
def rfid():
#This will just see if the rfid chip has enough digits
main= 8974
# This looks to see if the rfid chip has enough digits to pass the test
if main == x:
print ("Card read check complete")
cardlength= info[main + readlen]
main += readlen + 1
return True,info[main:main + cardlength]
else:
main += readlen + 1
return False,0,''
def main():
rfid(x)
main()
首先,你必须解决这个问题:
你看,如果一个函数需要一个参数,它必须被声明为这样。接下来,您必须从
test()
调用rfid()
:在
main()
中,调用test()
。或者只调用test()
,不需要声明和调用main()
:相关问题 更多 >
编程相关推荐