I'm trying to load a list back into the program from a text file using pickle:
f = open("usernames.txt", "r")
usernames = pickle.load(f)
f.seek(0)
f.truncate(0)
f.close()
However when I run the code this error message appears:
TypeError: a bytes-like object is required, not 'str'
How can I resolve this error?