Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
binary integer confusion
#8
(Dec-25-2020, 10:01 PM)ndc85430 Wrote: So data is a bytes object? You need to convert it to an int then. Again, the int function accepts bytes as the documentation says.


Data is sent from PC (max/msp) via Serial. Either as an integer or ascii (with same results)

I try:

integer=int.from_bytes(data,¨little¨)
and

integer=int.from_bytes(data, "big")
either way a get

255 or 254
Reply


Messages In This Thread
binary integer confusion - by Moris526 - Dec-25-2020, 05:56 PM
RE: binary integer confusion - by ndc85430 - Dec-25-2020, 06:01 PM
RE: binary integer confusion - by Moris526 - Dec-25-2020, 07:27 PM
RE: binary integer confusion - by ndc85430 - Dec-25-2020, 07:31 PM
RE: binary integer confusion - by Moris526 - Dec-25-2020, 09:07 PM
RE: binary integer confusion - by Moris526 - Dec-25-2020, 09:10 PM
RE: binary integer confusion - by ndc85430 - Dec-25-2020, 10:01 PM
RE: binary integer confusion - by Moris526 - Dec-26-2020, 03:22 AM
RE: binary integer confusion - by ndc85430 - Dec-26-2020, 05:58 AM
RE: binary integer confusion - by Moris526 - Dec-26-2020, 06:58 AM
RE: binary integer confusion - by DeaD_EyE - Dec-26-2020, 10:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  hex file to binary or pcap to binary baran01 1 5,826 Dec-11-2019, 10:19 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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