Apr-26-2017, 04:55 AM
i have a few programs to write that i could have written in C and would have had no problems. but i started writing them in Python3 and am running into the code conversion issues because a few of the bytes are above 127 in value. and they are not all valid UTF-8. they do not represent Unicode characters. they are raw bytes. they are what they are. but Python3 gets upset over them. i have been trying to read the documentation on this, but it is confusing. i need to use bytes. but many parts of Python just don't work with raw bytes as-is. is there a document somewhere that explains bytes and how to use them much like you would in C so i don't have to switch back to C?
for example when i have:
for example when i have:
for line in sys.stdin: do_something(line)how can i have the value of line be bytes, even with some bytes > 127?