25 lines
591 B
Python
25 lines
591 B
Python
import serial
|
|
|
|
ser = serial.Serial("COM7", 19200, timeout=0.1)
|
|
|
|
#def read_until(until):
|
|
# out = ()
|
|
# while 'until' != 'out':
|
|
# out = (ser.read(1000))
|
|
# return out
|
|
|
|
def read_until(something):
|
|
output = ()
|
|
while something not in output:
|
|
output = (ser.read(124000))
|
|
#print (output)
|
|
return output
|
|
|
|
print ("__Attente de la réponse du board")
|
|
print ((read_until(b'>>')).decode())
|
|
|
|
ser.write(('933d86ae930c9a5d6d3a334297d9e72852f05c57#cat.txt:finances.csv\r\n').encode())
|
|
print ("__Attaque")
|
|
|
|
print ("__Attente de la réponse après l'attaque")
|
|
print (((read_until(b'\r\n\r\n'))).decode())
|