Python Forum
How can I add an end line character after every value that I receive?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I add an end line character after every value that I receive?
#6
I believe the data is terminated with newline due to the example he gave (For ex: printf("%d\n",data). The code he posted is receiving and decoding ASCII codes ? and printing them to file. Originally he left the newline untouched which formatted his csv file into columns, when he removed that format the data got placed on the spreadsheet in continuous rows, the fact that the column data got separated makes me think that those values each equate to the value of one 32 bit integer printf("%d\n",data). The purposed of the 'D' character is to break out of the while loop when he has finished his logging session not for separating samples. I also believe there may be a certain lack of understanding about the difference of reading bytes or bytes encoded as ASCII characters. Until he responds we wont know for certain, it would be nice to see what is being sent and compare to what is received, the 17 or so values that we see range from 77 to 85 it would be nice to know if that was expected.
Reply


Messages In This Thread
RE: How can I add an end line character after every value that I receive? - by Jeff_t - Mar-04-2022, 02:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to receive two passed cmdline parameters and access them inside a Python script? pstein 2 411 Feb-17-2024, 12:29 PM
Last Post: deanhystad
  Receive Input on Same Line? johnywhy 8 850 Jan-16-2024, 03:45 AM
Last Post: johnywhy
  How to continuously receive messages until specified to stop using Bleak jacobbreen25 3 2,254 Dec-28-2022, 04:25 PM
Last Post: jacobbreen25
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,460 Sep-27-2022, 01:38 PM
Last Post: buran
  How to receive webcam capture on spout? buzzdarkyear 2 2,722 Jan-12-2022, 02:26 PM
Last Post: buzzdarkyear
  [solved] unexpected character after line continuation character paul18fr 4 3,546 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  new line character project_science 3 2,176 Jan-01-2021, 02:32 PM
Last Post: project_science
  SyntaxError: unexpected character after line continuation character siteshkumar 2 3,246 Jul-13-2020, 07:05 PM
Last Post: snippsat
  Regex won't replace character with line break Tomf96 2 2,606 Jan-12-2020, 12:14 PM
Last Post: Tomf96
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 2,800 Jan-05-2020, 11:50 AM
Last Post: vivekagrey

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020