I'm using Python 2.7 (that means that there is no base64.decodebytes())
I need to convert my base64 string, for example aW0ganVzdCBhIGJhc2UgNjQgZmlsZQ== into binary (i.e string of 1's and 0's).
I thought to try and write the base 64 string to a file in mode wb and then read it back with rb but even when used wb to write - I still see the original base 64 string when opening the file..
What am I missing?
Thanks
That's right. You can see the readable characters even if you save them into binary file. Because they are ASCII characters.
Actually, you are not going to save file with binary format, because you can't get the binary string by save it with 'wb'.
What you should do is to get the ASCII value of every character, and convert it to binary number.
Python 2.7 - convert base 64 to binary string