Guest User

Untitled

a guest
May 26th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. marker = '1'
  2. msg_list = []
  3. while marker != '\\n':
  4. marker = ser.read(1)
  5. msg_list.append(marker)
  6.  
  7. #i get a list of bytes.
  8. #then if i do
  9.  
  10. f = open('filename', 'wb')
  11. for i in msg_list:
  12. f.write(i)
  13. f.close()
  14.  
  15.  
  16. # now when i do this
  17.  
  18. msg = ser.read(24)
  19. f = open('filename', 'wb')
  20. f.write(msg)
  21. f.close()
  22.  
  23. if i do in a linux term
  24. file filename, it says data
  25. but says something like ascii file if i do it the earlier way.
  26.  
  27. does this make sense?
Add Comment
Please, Sign In to add comment