I’m trying to do something where I save a pickle file to a specific folder. In the pickle.dump(data, file)
line, I have data as what to save and file as the folder to save it to, but it says I need a ‘write’ tag on the file variable. What do I change? The variable is equal to another variable, and looks like this: file = pkl_file
When I reach the part of the program that tries to save the pickle file, I get this error message:
Traceback (most recent call last): File "/Users/tellinghawk4837/PythonOS-main/Python OS Beta 1.1.py", line 26, in <module> pickle.dump(data,file) TypeError: file must have a 'write' attribute
What do I change to make it work?