In my Python project, I'm using an object class Forecast with some attributes (temperature, humidity etc...). I want to use 2 scripts, one for writing the data into a binary file, one to read it.
I tried both
f = open(file,"wb") 
f.write(object)
and
pickle.dump(object, open(file,"wb"))
but my problem is writing class objects with pickle won't let me read it properly with pickle.load,
and f.write won't let me do this because 'bytes-like objects are required'.
Can someone tell me if there is any other way to do it?
 
     
    