I'm trying to figure out how I can open a file via a pathvariable in binary mode.
So basically I want instead of:
open(b'picklefile.p', 'wb')
this
path = /picklefiles/picklefile.p
open(b'path', 'wb')
I tried to solve this by leaving the b out but apparently, things go wrong. I wasn't able to find a way that allows me to use a variable as every available example uses the direct path, am I overlooking something or is it not possible so I need to convert it somehow?