я USB RFID считыватель подключены к Raspberry Pi читатель RFID является китайским брендом он действует как клавиатуры и прочитать первые 10 цифрUSB RFID считыватель + малина пи
так, что я пытаюсь сделать здесь считан с карты и сравнение с записанным номером в моем коде
#!/usr/bin/env python
import time
import sys
card = '0019171125' # Stored good card number consider using a list or a file.
def main(): # define a main function.
while True: # loop until the program encounters an error.
sys.stdin = open('/dev/tty0', 'r')
RFID_input = input()
if RFID_input == card: # coppare the stored number to the input and if True execute code.
print "Access Granted"
print "Read code from RFID reader:{0}".format(RFID_input)
else: # and if the condition is false excecute this code.
print "Access Denied"
tty.close()
main() # call the main function.
, но эта ошибка держать показывая
RFID_input = input()
^ IndentationError: unindent does not match any outer indentation level
любого предложение
Вы не отступа код правильно. Весь код под 'main()' должен быть отступом, а в цикле 'while' также требуется отступ. – jayelm
Я думаю, вы должны действительно прочитать учебник по python, прежде чем продолжить свой проект. – RedX