From fb67ec04cbfa37a2c075d5ebc372ced4a8e10cb5 Mon Sep 17 00:00:00 2001 From: tpltnt <1172976+tpltnt@users.noreply.github.com> Date: Sun, 9 Oct 2022 11:47:40 +0200 Subject: [PATCH] minimal Python 3 port --- doc/script/simple_stream.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/script/simple_stream.py b/doc/script/simple_stream.py index 67c2a2c..a01614f 100755 --- a/doc/script/simple_stream.py +++ b/doc/script/simple_stream.py @@ -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 to exit and disable grbl.") # Close file and serial port f.close() -s.close() \ No newline at end of file +s.close()