Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Escribir archivo
- f=open("salida.bin","wb")
- data=[1,1,1,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,00,0,0,1,0,1,0,1,1,1,1,0,0,1,1,1,0,1,1,1,1,0,0,1]
- print(data)
- arr=bytearray(data)
- f.write(arr)
- f.close()
- #Leer archivo
- fin = open("salida.bin","rb")
- dataIn = fin.read()
- dataDec = [data[x] for x in range(0,len(dataIn))]
- print(dataDec)
- fin.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement