minimal Python 3 port

pull/1166/head
tpltnt 2022-10-09 11:47:40 +02:00
rodzic bfb67f0c79
commit fb67ec04cb
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""\
Simple g-code streaming script for grbl
@ -53,14 +53,14 @@ s.flushInput() # Flush startup text in serial input
# Stream g-code to grbl
for line in f:
l = line.strip() # Strip all EOL characters for consistency
print 'Sending: ' + l,
print(f"Sending {l}", end="")
s.write(l + '\n') # Send g-code block to grbl
grbl_out = s.readline() # Wait for grbl response with carriage return
print ' : ' + grbl_out.strip()
print(' : ' + grbl_out.strip())
# Wait here until grbl is finished to close serial port and file.
raw_input(" Press <Enter> to exit and disable grbl.")
# Close file and serial port
f.close()
s.close()
s.close()