kopia lustrzana https://github.com/gnea/grbl
minimal Python 3 port
rodzic
bfb67f0c79
commit
fb67ec04cb
|
@ -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()
|
||||
|
|
Ładowanie…
Reference in New Issue