so I wasn't sure how to phrase this in a search so I will give you the details. I'm using an nfc reader and if a card is found an action is performed. What I want to do is add a part where if the card is not in the database print "unknown card"
heres my script essentially. max = sum of lines in a text file cardid = card uid #
for i in range(max)
with open(....) as file
card = file.readlines()[i]
if cardid == card
print "card found"
that is pretty much what i have so far. it works as expected. The only workaround I can see is adding a variable 'cardfound' and doing this
cardfound = 0
for i in range(max)
with open(....) as file
card = file.readlines()[i]
if cardid == card
print "card found"
cardfound = 1
if cardfound == 0
print "unknown card"
is there a better method?