Python Forum
documentation for raw bytes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
documentation for raw bytes
#2
Where do you get the error, specifically? You should be able to just .encode() the input to get a bytes object.
for line in sys.stdin:
    do_something(line.encode())
Reply


Messages In This Thread
documentation for raw bytes - by Skaperen - Apr-26-2017, 04:55 AM
RE: documentation for raw bytes - by nilamo - Apr-26-2017, 05:31 AM
RE: documentation for raw bytes - by Skaperen - Apr-26-2017, 06:01 AM
RE: documentation for raw bytes - by volcano63 - Apr-26-2017, 06:25 PM
RE: documentation for raw bytes - by Ofnuts - Apr-26-2017, 09:24 PM

Forum Jump:

User Panel Messages

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