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?
#8
(Mar-03-2022, 11:04 AM)Larz60+ Wrote: you should only initialize ports once and close at the end of your session.
see: https://pyserial.readthedocs.io/en/lates...intro.html
Hi,

Thanks for the suggestion. But I am a bit confused, I am only initializing the ports once I believe.
By "closing at the end of your session" do you mean after the loop breaks (or after the file is filled with data and closed)?
Or do you mean in general, like at the end of the code, when I am done with everything?
Basically, in my case, I am running the code until the battery pack (power bank connected as power supply to RPi) gets dead, so I believe all the ports get reset when RPi is powered up gain.
Please correct me if I am wrong somewhere. Thanks.
Reply


Messages In This Thread
RE: How can I add an end line character after every value that I receive? - by GiggsB - Mar-06-2022, 07:07 AM

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 406 Feb-17-2024, 12:29 PM
Last Post: deanhystad
  Receive Input on Same Line? johnywhy 8 846 Jan-16-2024, 03:45 AM
Last Post: johnywhy
  How to continuously receive messages until specified to stop using Bleak jacobbreen25 3 2,243 Dec-28-2022, 04:25 PM
Last Post: jacobbreen25
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,449 Sep-27-2022, 01:38 PM
Last Post: buran
  How to receive webcam capture on spout? buzzdarkyear 2 2,712 Jan-12-2022, 02:26 PM
Last Post: buzzdarkyear
  [solved] unexpected character after line continuation character paul18fr 4 3,523 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  new line character project_science 3 2,173 Jan-01-2021, 02:32 PM
Last Post: project_science
  SyntaxError: unexpected character after line continuation character siteshkumar 2 3,235 Jul-13-2020, 07:05 PM
Last Post: snippsat
  Regex won't replace character with line break Tomf96 2 2,602 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,795 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