Skip to content

Instantly share code, notes, and snippets.

@JerzySpendel
Created February 6, 2014 15:41
Show Gist options
  • Save JerzySpendel/8846623 to your computer and use it in GitHub Desktop.
Save JerzySpendel/8846623 to your computer and use it in GitHub Desktop.
import requests
import pyserial
import time
def normalizeData(text):
lines = []
for line in text.split('\n'):
lines.append(line)
data = ''
for line in lines:
data += line
return data
data = requests.get('http://www.modelmania.com.pl/test_drukarka.txt').text
data = normalizeData(data)
dev = serial.Serial('/dev/ttyUSB0', 19200, timeout=1)
dev.write("$05")
print(dev.read(1024**2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment