diff --git a/src/Mod/Path/PathScripts/TooltableEditor.py b/src/Mod/Path/PathScripts/TooltableEditor.py index 84930c3d162d..f55d275ae6c4 100644 --- a/src/Mod/Path/PathScripts/TooltableEditor.py +++ b/src/Mod/Path/PathScripts/TooltableEditor.py @@ -70,8 +70,8 @@ def startElement(self, tag, attributes): self.tool.Name = str(attributes["name"]) self.tool.ToolType = str(attributes["type"]) self.tool.Material = str(attributes["mat"]) - # for some reason without the following line I get an error - print attributes["diameter"] + # for some reason without the following line I get an error + print(attributes["diameter"]) self.tool.Diameter = float(attributes["diameter"]) self.tool.LengthOffset = float(attributes["length"]) self.tool.FlatRadius = float(attributes["flat"]) @@ -122,8 +122,8 @@ def startElement(self, tag, attributes): self.tool.Material = "HighSpeedSteel" elif m == "1": self.tool.Material = "Carbide" - # for some reason without the following line I get an error - print attributes["diameter"] + # for some reason without the following line I get an error + print(attributes["diameter"]) self.tool.Diameter = float(attributes["diameter"]) self.tool.LengthOffset = float(attributes["tool_length_offset"]) self.tool.FlatRadius = float(attributes["flat_radius"]) @@ -654,7 +654,7 @@ def delete(self): def addnew(self): "adds a new tool at the end of the table" tool = Path.Tool() - print self.NameField + print(self.NameField) if self.NameField.text(): tool.Name = str(self.NameField.text()) tool.ToolType = self.getType(self.TypeField.currentIndex()) @@ -695,8 +695,8 @@ def write(self): fil.write('\n') fil.write(self.tooltable.Content) fil.close() - print "Written ", filename[0] - + print("Written ",filename[0]) + def moveup(self): "moves a tool to a lower number, if possible" if self.number: diff --git a/src/Mod/Path/PathScripts/centroid_post.py b/src/Mod/Path/PathScripts/centroid_post.py index dbae475d9057..df3c2b134f15 100644 --- a/src/Mod/Path/PathScripts/centroid_post.py +++ b/src/Mod/Path/PathScripts/centroid_post.py @@ -73,7 +73,7 @@ def export(selection,filename,argstring): params = ['X','Y','Z','A','B','I','J','F','H','S','T','Q','R','L'] #Using XY plane most of the time so skipping K for obj in selection: if not hasattr(obj,"Path"): - print "the object " + obj.Name + " is not a path. Please select only path and Compounds." + print("the object " + obj.Name + " is not a path. Please select only path and Compounds.") return myMachine = None for pathobj in selection: diff --git a/src/Mod/Path/PathScripts/example_pre.py b/src/Mod/Path/PathScripts/example_pre.py index fbe43ec99ae3..0a90cf3af284 100644 --- a/src/Mod/Path/PathScripts/example_pre.py +++ b/src/Mod/Path/PathScripts/example_pre.py @@ -60,7 +60,7 @@ def insert(filename,docname): def parse(inputstring): "parse(inputstring): returns a parsed output string" - print "preprocessing..." + print("preprocessing...") # split the input by line lines = inputstring.split("\n") @@ -93,9 +93,9 @@ def parse(inputstring): # no G or M command: we repeat the last one output += lastcommand + " " + l + "\n" - print "done preprocessing." + print("done preprocessing.") return output -print __name__ + " gcode preprocessor loaded." +print(__name__ + " gcode preprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/rml_post.py b/src/Mod/Path/PathScripts/rml_post.py index 3460f9d4b5e5..edd9835d5915 100644 --- a/src/Mod/Path/PathScripts/rml_post.py +++ b/src/Mod/Path/PathScripts/rml_post.py @@ -135,15 +135,15 @@ def xyarc(args, state): steps = 64 # TODO: specify max error instead points = arc.discretize(steps) # TODO: consider direction - #print 'p = Part.ArcOfCircle(Part.Circle(FreeCAD.Vector(%f, %f), FreeCAD.Vector(0, 0, 1), %f), %f, %f)' % (center.x, center.y, radius, p0, p1) + #print('p = Part.ArcOfCircle(Part.Circle(FreeCAD.Vector(%f, %f), FreeCAD.Vector(0, 0, 1), %f), %f, %f)' % (center.x, center.y, radius, p0, p1)) for p in points: - #print 'p', p.x, p.y + #print('p', p.x, p.y) c += feed(p.x, p.y, state['Z'], state) return c def speed(xy=None, z=None, state={}): c = [] - print xy, z, state + print(xy, z, state) if xy is not None: xy = float(xy) if xy > 0.0 and xy != state['XYspeed']: @@ -235,7 +235,7 @@ def parse(inputstring): continue parsed = PostUtils.stringsplit(line) command = parsed['command'] - print 'cmd', line + print('cmd', line) try: if command: code = convertgcode(command, parsed, state) @@ -243,8 +243,8 @@ def parse(inputstring): code = [ code ] if len(code) and code[0]: output += code - except NotImplementedError, e: - print e + except NotImplementedError as e: + print(e) # footer output += motoroff() @@ -253,5 +253,5 @@ def parse(inputstring): return '\n'.join(output) -print __name__ + " gcode postprocessor loaded." +print (__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/slic3r_pre.py b/src/Mod/Path/PathScripts/slic3r_pre.py index 2e25659fb128..004fb5aa41df 100644 --- a/src/Mod/Path/PathScripts/slic3r_pre.py +++ b/src/Mod/Path/PathScripts/slic3r_pre.py @@ -55,7 +55,7 @@ def insert(filename,docname): def parse(inputstring): "parse(inputstring): returns a parsed output string" - print "preprocessing..." + print("preprocessing...") # split the input by line lines = inputstring.split("\n") @@ -89,9 +89,9 @@ def parse(inputstring): # no G or M command: we repeat the last one output += lastcommand + " " + l + "\n" - print "done preprocessing." + print("done preprocessing.") return output -print __name__ + " gcode preprocessor loaded." +print (__name__ + " gcode preprocessor loaded.")