Guest User

Untitled

a guest
Oct 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. try:
  2. client.send(b'x01x**')
  3. print("sent")
  4. data1 = client.recv(1024)
  5. print(" ".join("{:02x}".format(byte) for byte in (data1)))
  6. time.sleep(1)
  7. client.send(b'x01x**')
  8. data2 = client.recv(1024)
  9. print(" ".join("{:02x}".format(byte) for byte in (data2)))
  10. with open('D:data_%d.csv'% i, "w") as csv_file:
  11. writer = csv.writer(csv_file, delimiter=',')
  12. filename1 = " ".join("{:02x}".format(byte) for byte in data1)
  13. filename2 = " ".join("{:02x}".format(byte) for byte in data2)
  14. writer.writerow((filename1,filename2,time.ctime()))
Add Comment
Please, Sign In to add comment