I have two rfid card the values are 0004518403 and 000452738 after reading their value in python terminal. I want to give them name like 0004518403 is "javed" and 000452738 as "aquib". So when next time when I use the card it must not show me the value but it must show me the name which I've defined to them.
import serial
import time
serial = serial.Serial('/dev/ttyUSB0', baudrate = 9600)
while True:
if serial.inWaiting() > 0:
read_result =serial.read(15)
print("Sleeping 2 seconds")
if(read_result==0004520738):
print "aquib"
elif(read_result==0004518403):
print "javed"
time.sleep(2)
serial.flushInput() # ignore errors, no data
I am trying this code but it show me an error :
SyntaxError: invalid token
In the first if condition. I am not getting where is the problem.