I am currently struggling with binary to string conversion in python. Thanks to the bin fonction, the opposite conversion is simple, but I can't find on the internet how to do so. If one of you is willing to help, I'd welcome any answer. thanks
Asked
Active
Viewed 7,849 times
-2
-
Can you show us the code you already have? – Olaf Górski Apr 03 '18 at 12:20
-
Possible duplicate: [Convert base-2 binary number string to int](https://stackoverflow.com/q/8928240/1288) – Bill the Lizard Apr 03 '18 at 12:21
-
2Possible duplicate of [How to convert 'binary string' to normal string in Python3?](https://stackoverflow.com/questions/17615414/how-to-convert-binary-string-to-normal-string-in-python3) – Austin Apr 03 '18 at 12:21
-
Possible duplicate of [Convert base-2 binary number string to int](https://stackoverflow.com/questions/8928240/convert-base-2-binary-number-string-to-int) – Keyur Potdar Apr 03 '18 at 12:35
1 Answers
1
binary_string = b'test'
print(binary_string)
regular_string = binary_string.decode('utf-8')
print(regular_string)
Output:
b'test'
test

Epion
- 458
- 3
- 7