Kart Programı
from time import sleep
import webbrowser
import sys
#import Timer
import os
import subprocess
import datetime
from mfrc522 import SimpleMFRC522
reader = SimpleMFRC522()
sayac=0
# def oku():
# os.system("firefox http:\\www.temelelektronik.info/okul/oku.aspx")
# sayac=sayac+1
# print(sayac)
#
# t = Timer(90.0, oku)
# t.start()
try:
while True:
print("Kartinizi Okuyucuya Tutun!")
id, text = reader.read()
print("ID: %s\nText: %s" % (id,text))
#p=subprocess
if id>0:
#url="lxterminal --command='/usr/bin/firefox http:\\www.temelelektronik.info/yoklama.aspx?rfid="+str(id)+"'"
#p=subprocess.Popen(["/usr/bin/firefox","http:\\www.temelelektronik.info/yoklama.aspx?rfid="+str(id)])
webbrowser.open('http:\\www.temelelektronik.info/yoklama.aspx?rfid='+str(id),new=2,autoraise=True)
#os.system(url)
#os.system('sudo -upi firefox http:\\www.temelelektronik.info/yoklama.aspx?rfid='+str(id)+'')
file_object=open("yoklama.txt",'a')
file_object.write(str(datetime.datetime.now().strftime("%d/%m/%Y %A %H:%M:%S |")))
file_object.write(str(id))
file_object.write("\n")
file_object.close()
sayac=sayac+1
print(sayac)
sleep(3)
if sayac>20:
sleep(5)
os.system("pkill firefox")
sayac=0
except KeyboardInterrupt:
GPIO.cleanup()
raise
***