diff --git a/src/Mod/TemplatePyMod/Automation.py b/src/Mod/TemplatePyMod/Automation.py index 7de97f1b62c3..849247f105d1 100644 --- a/src/Mod/TemplatePyMod/Automation.py +++ b/src/Mod/TemplatePyMod/Automation.py @@ -79,7 +79,7 @@ def makeSnapshotWithoutGui(): # Other formats are only available if simage package is installed if off.isWriteSupported("PNG"): - print "Save as PNG" + print("Save as PNG") off.writeToFile("crystal.png","PNG") if FreeCAD.GuiUp: diff --git a/src/Mod/TemplatePyMod/Commands.py b/src/Mod/TemplatePyMod/Commands.py index 7746653643a7..e87f4a8b854e 100644 --- a/src/Mod/TemplatePyMod/Commands.py +++ b/src/Mod/TemplatePyMod/Commands.py @@ -28,7 +28,7 @@ def addCommand(name,cmdObject): class TemplatePyMod_Cmd1: "Example command class" def Activated(self): - print "TemplatePyMod_Cmd1 activated ;-) " + print("TemplatePyMod_Cmd1 activated ;-) ") def GetResources(self): return {'Pixmap' : 'Std_Tool1', 'MenuText': 'Example command', 'ToolTip': 'Very unimportand example command'} @@ -235,9 +235,9 @@ class TemplatePyCheckable: "Example toggle command class" def Activated(self, index): if index == 0: - print "Toggle is off" + print("Toggle is off") else: - print "Toggle is on" + print("Toggle is on") def GetResources(self): return {'Pixmap' : 'python', 'MenuText': 'Toggle command', 'ToolTip': 'Example toggle command', 'Checkable': True} diff --git a/src/Mod/TemplatePyMod/FeaturePython.py b/src/Mod/TemplatePyMod/FeaturePython.py index 3d1f1c990d02..46204659c0bf 100644 --- a/src/Mod/TemplatePyMod/FeaturePython.py +++ b/src/Mod/TemplatePyMod/FeaturePython.py @@ -654,7 +654,7 @@ def __init__(self, obj): obj.Proxy = self def updateData(self, fp, prop): - print "prop updated:",prop + print("prop updated:",prop) def __getstate__(self): return None diff --git a/src/Mod/TemplatePyMod/MengerSponge.py b/src/Mod/TemplatePyMod/MengerSponge.py index 1c058334d228..90b5ce8d59ba 100644 --- a/src/Mod/TemplatePyMod/MengerSponge.py +++ b/src/Mod/TemplatePyMod/MengerSponge.py @@ -20,7 +20,7 @@ def PlaceBox(x,y,z): return mbox def Sierpinski(level,x0,y0,z0): - #print threading.current_thread().name + #print(threading.current_thread().name) boxnums = pow(3,level) thirds = boxnums / 3 twothirds = thirds * 2 @@ -95,7 +95,7 @@ def makeMengerSponge_mt(level=3,x0=0,y0=0,z0=0): threads.append(thr) args=args[count:] - print "Number of threads: %i" % (len(threads)) + print("Number of threads: %i" % (len(threads))) for thr in threads: thr.start() for thr in threads: @@ -106,11 +106,11 @@ def makeMengerSponge_mt(level=3,x0=0,y0=0,z0=0): mesh.addMesh(thr.mesh) del thr.mesh - print mesh + print(mesh) mesh.removeDuplicatedPoints() mesh.removeFacets(mesh.getInternalFacets()) mesh.rebuildNeighbourHood() - print "Mesh is solid: %s" % (mesh.isSolid()) + print("Mesh is solid: %s" % (mesh.isSolid())) Mesh.show(mesh) @@ -121,5 +121,5 @@ def makeMengerSponge(level=3,x0=0,y0=0,z0=0): mesh.removeDuplicatedPoints() mesh.removeFacets(mesh.getInternalFacets()) mesh.rebuildNeighbourHood() - print "Mesh is solid: %s" % (mesh.isSolid()) + print("Mesh is solid: %s" % (mesh.isSolid())) Mesh.show(mesh) diff --git a/src/Mod/TemplatePyMod/Tests.py b/src/Mod/TemplatePyMod/Tests.py index 6b521df84d87..43da7472f06b 100644 --- a/src/Mod/TemplatePyMod/Tests.py +++ b/src/Mod/TemplatePyMod/Tests.py @@ -69,14 +69,14 @@ def testNesting(self): # Parameter testing #FreeCAD.PrintLog("Base::ParameterTestCase::testNesting\n") for i in range(50): - self.TestPar.SetFloat(`i`,4711.4711) - self.TestPar.SetInt(`i`,4711) - self.TestPar.SetBool(`i`,1) - Temp = self.TestPar.GetGroup(`i`) + self.TestPar.SetFloat(i,4711.4711) + self.TestPar.SetInt(i,4711) + self.TestPar.SetBool(i,1) + Temp = self.TestPar.GetGroup(i) for l in range(50): - Temp.SetFloat(`l`,4711.4711) - Temp.SetInt(`l`,4711) - Temp.SetBool(`l`,1) + Temp.SetFloat(l,4711.4711) + Temp.SetInt(l,4711) + Temp.SetBool(l,1) Temp = 0 def testExportImport(self):