I need to get the Python script read from a text file instead of having the tag IDs be in the script
itself so you dont have to stop the script and edit the actual script itself to input a new user. Thanks
everyone and let me know if you have any more questions or if I can help in any way! can we also
try to make the arduino code read from that text file as well? That way if we wanted to add or
delete users we can just open the text file and edit and save that. Then that way both codes will be
updated with the list of users at the same time and it's much easier to edit the list of users. I think
this would improve our project a lot if we could do that
from authy.api import AuthyApiClient
from datetime import datetime, timedelta
import serial
import time
import sys
import io
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.setup(27, GPIO.OUT)
arduino = serial.Serial('/dev/ttyACM0', 9600)
#arduino_data = arduino.readline()
timeout = 9
data =[]
for i in range(50):
b = arduino.readline()
string_n = b.decode()
string = string_n.rstrip()
s = str(string)
print(s)
data.append(s)
time.sleep(0.1)
if s == " 21 F8 7C 26":
authy_api = AuthyApiClient('jtJEfq9PPAdHOALNrt8FsVescO1C6RrZ')
response = authy_api.one_touch.send_request(
593152871, #adam
"Requesting login for Encation",
seconds_to_expire=120)
if response.ok():
print(response.get_uuid())
else:
print(response.errors())
#time.sleep(8)
old_stdout = sys.stdout
sys.stdout = buffer = io.StringIO()
if response.ok():
status = authy_api.one_touch.get_approval_status(response.get_uuid())
print(status.content)
sys.stdout = old_stdout
statuscontent = buffer.getvalue()
print(statuscontent)
index = statuscontent.find("approved")
timeout_start = time.time()
test = 0
while index != 339 and time.time() < timeout_start + timeout:
print(index)
old_stdout = sys.stdout
sys.stdout = buffer = io.StringIO()
if response.ok():
status = authy_api.one_touch.get_approval_status(response.get_uuid())
print(status.content)
sys.stdout = old_stdout
statuscontent = buffer.getvalue()
#print(index)
print(statuscontent)
index = statuscontent.find("approved")
if index == 339:
break
if test == 0.15:
break
test -= 1
if index == 339:
print('yes')
GPIO.output(17, True)
GPIO.output(27, True)
time.sleep(5)
GPIO.output(17, False)
GPIO.output(27, False)
else:
print('no')
if s == " D3 99 12 2E":
authy_api = AuthyApiClient('jtJEfq9PPAdHOALNrt8FsVescO1C6RrZ')
response = authy_api.one_touch.send_request(
596467975, #rachel
"Requesting login for Encation",
seconds_to_expire=120)
if response.ok():
print(response.get_uuid())
else:
print(response.errors())
#time.sleep(8)
old_stdout = sys.stdout
sys.stdout = buffer = io.StringIO()
#sys.stdout = old_stdout
#statuscontent = buffer.getvalue()
if response.ok():
status = authy_api.one_touch.get_approval_status(response.get_uuid())
print(status.content)
sys.stdout = old_stdout
statuscontent = buffer.getvalue()
print(statuscontent)
index = statuscontent.find("approved")
timeout_star.
9548086042 for call girls in Indira Nagar with room service
I need to get the Python script read from a text file instea.pdf
1. I need to get the Python script read from a text file instead of having the tag IDs be in the script
itself so you dont have to stop the script and edit the actual script itself to input a new user. Thanks
everyone and let me know if you have any more questions or if I can help in any way! can we also
try to make the arduino code read from that text file as well? That way if we wanted to add or
delete users we can just open the text file and edit and save that. Then that way both codes will be
updated with the list of users at the same time and it's much easier to edit the list of users. I think
this would improve our project a lot if we could do that
from authy.api import AuthyApiClient
from datetime import datetime, timedelta
import serial
import time
import sys
import io
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.setup(27, GPIO.OUT)
arduino = serial.Serial('/dev/ttyACM0', 9600)
#arduino_data = arduino.readline()
timeout = 9
data =[]
for i in range(50):
b = arduino.readline()
string_n = b.decode()
string = string_n.rstrip()
s = str(string)
print(s)
data.append(s)
time.sleep(0.1)
if s == " 21 F8 7C 26":
authy_api = AuthyApiClient('jtJEfq9PPAdHOALNrt8FsVescO1C6RrZ')
response = authy_api.one_touch.send_request(
593152871, #adam
"Requesting login for Encation",
seconds_to_expire=120)
if response.ok():
print(response.get_uuid())
else:
print(response.errors())
#time.sleep(8)
old_stdout = sys.stdout
2. sys.stdout = buffer = io.StringIO()
if response.ok():
status = authy_api.one_touch.get_approval_status(response.get_uuid())
print(status.content)
sys.stdout = old_stdout
statuscontent = buffer.getvalue()
print(statuscontent)
index = statuscontent.find("approved")
timeout_start = time.time()
test = 0
while index != 339 and time.time() < timeout_start + timeout:
print(index)
old_stdout = sys.stdout
sys.stdout = buffer = io.StringIO()
if response.ok():
status = authy_api.one_touch.get_approval_status(response.get_uuid())
print(status.content)
sys.stdout = old_stdout
statuscontent = buffer.getvalue()
#print(index)
print(statuscontent)
index = statuscontent.find("approved")
if index == 339:
break
if test == 0.15:
break
test -= 1
if index == 339:
print('yes')
GPIO.output(17, True)
GPIO.output(27, True)
time.sleep(5)
GPIO.output(17, False)
GPIO.output(27, False)
else:
print('no')
if s == " D3 99 12 2E":
authy_api = AuthyApiClient('jtJEfq9PPAdHOALNrt8FsVescO1C6RrZ')
response = authy_api.one_touch.send_request(
596467975, #rachel
3. "Requesting login for Encation",
seconds_to_expire=120)
if response.ok():
print(response.get_uuid())
else:
print(response.errors())
#time.sleep(8)
old_stdout = sys.stdout
sys.stdout = buffer = io.StringIO()
#sys.stdout = old_stdout
#statuscontent = buffer.getvalue()
if response.ok():
status = authy_api.one_touch.get_approval_status(response.get_uuid())
print(status.content)
sys.stdout = old_stdout
statuscontent = buffer.getvalue()
print(statuscontent)
index = statuscontent.find("approved")
timeout_start = time.time()
test = 0
while index != 339 and time.time() < timeout_start + timeout:
print(index)
old_stdout = sys.stdout
sys.stdout = buffer = io.StringIO()
if response.ok():
status = authy_api.one_touch.get_approval_status(response.get_uuid())
print(status.content)
sys.stdout = old_stdout
statuscontent = buffer.getvalue()
#print(index)
print(statuscontent)
index = statuscontent.find("approved")
if index == 339:
break
if test == 0.15:
break
test -= 1
if index == 339:
print('yes')