import time with open('/dev/data16_adc12', 'r') as f: for line in f: print(line.encode('bin')) time.sleep(0.1)