0%
1 2 3 4 5 6 7 8 9 10 11
| import binascii
filePath = "mysong.mp3" file = open(filePath, "rb") with file: byte = file.read(1) hexadecimal = binascii.hexlify(byte) decimal = int(hexadecimal, 16) binary = bin(decimal)[2:].zfill(8) print("hex: %s, decimal: %s, binary: %s" % (hexadecimal, decimal, binary))
|