Python - Weird Error Encountered
launcherman08 (22)

Hey, so I'm building a game. I asked a question before. (Click to view the question) I did all the load stuff different, but then I encounter this (really) weird error:

Help please!

You are viewing a single comment. View All
mat1 (3341)

Here is the code that's broken:

load = open("save.txt", "r")
company_data = pickle.load(load)

The reason why it's not working is because load is reading a string and not bytes. Replace the r (read) with rb (read bytes) to fix that.

Also, in lines 14-19 you are trying to get information from company_data with invalid variables. To fix this, replace them with strings (add quotes around stores, offices, etc)
Please mark my comment as the answer if it helped you. Thanks!