src/figures/script/pyfit: print -> print()
authorW. Trevor King <wking@tremily.us>
Wed, 17 Apr 2013 23:34:30 +0000 (19:34 -0400)
committerW. Trevor King <wking@tremily.us>
Wed, 17 Apr 2013 23:34:30 +0000 (19:34 -0400)
src/figures/script/pyfit

index 69ffa23f52588bc16d486688031e8e4cd5fa7546..032d92659db8d22c75b5a62363d528b4aedb3e3b 100755 (executable)
@@ -23,9 +23,9 @@ def parse_modules(module_strings):
     >>> m = parse_modules(['math:sin,cos', 'sys'])
     >>> import math, sys
     >>> if m == {'sin':math.sin, 'cos':math.cos, 'sys':sys}:
-    ...     print True
+    ...     print(True)
     ... else:
-    ...     print m
+    ...     print(m)
     True
     """
     ms = []
@@ -98,14 +98,14 @@ def fit(data, fn, initial_ps, _locals={}, verbose=False):
     if not hasattr(p, '__len__'):
         p = [p] # with only one param, leastsq doesn't return a list
     if verbose == True:
-        print "Fitted params:",p
-        print "Covariance mx:",cov
-        #print "Info:", info  # too much information :p                         
-        print "mesg:", mesg
+        print('Fitted params: {}'.format(p))
+        print('Covariance mx: {}'.format(cov))
+        #print('Info: {}'.format(info))  # too much information :p
+        print('mesg: {}'.format(mesg))
         if ier == 1 :
-            print "Solution converged"
+            print('Solution converged')
         else :
-            print "Solution did not converge"
+            print('Solution did not converge')
     return p
 
 
@@ -166,4 +166,4 @@ ignored.
     assert len(params) == len(initial_ps)
 
     for i,p in enumerate(params):
-        print '%s: %g' % (_param_char(i), p)
+        print('{}: {}'.format(_param_char(i), p))