i'm currently running this as a piece of my code for an i/o stream - i'm getting the following error TypeError: 'map' object is not subscriptable for the print (bytest[:10]). What's the proper way run it in Python 3?
with open("/bin/ls", "rb") as fin: #rb as text file and location
buf = fin.read()
bytes = map(ord, buf)
print (bytes[:10])
saveFile = open('exampleFile.txt', 'w')
saveFile.write(bytes)
saveFile.close()