Index: pycode-browser/Code/Maths/Calculus/compareEuRK4.py
===================================================================
--- pycode-browser.orig/Code/Maths/Calculus/compareEuRK4.py
+++ pycode-browser/Code/Maths/Calculus/compareEuRK4.py
@@ -18,7 +18,7 @@ y = 0.0     # for Euler
 z = 0.0     # for RK4
 
 while x < math.pi:
-     print x, y - math.sin(x), z - math.sin(x) # errors   
+     print( x, y - math.sin(x), z - math.sin(x) ) # errors
      y = y + h * math.cos(x)       # Euler method
      z = rk4(x,z,math.cos,h)       # Runge-Kutta method
      x = x + h
Index: pycode-browser/Code/Maths/Calculus/diff.py
===================================================================
--- pycode-browser.orig/Code/Maths/Calculus/diff.py
+++ pycode-browser/Code/Maths/Calculus/diff.py
@@ -7,6 +7,6 @@ def deriv(x,dx=0.005):
         df = f(x+dx/2)-f(x-dx/2)
         return df/dx
 
-print deriv(2.0)
-print deriv(2.0, 0.1)
-print deriv(2.0, 0.0001)
+print( deriv(2.0))
+print( deriv(2.0, 0.1))
+print( deriv(2.0, 0.0001))
Index: pycode-browser/Code/Maths/Calculus/euler.py
===================================================================
--- pycode-browser.orig/Code/Maths/Calculus/euler.py
+++ pycode-browser/Code/Maths/Calculus/euler.py
@@ -6,7 +6,7 @@ x = 0.0     # initail values
 y = 0.0
 
 while x < math.pi:
-     print x, y, math.sin(x)   
+     print( x, y, math.sin(x)   )
      y = y + h * math.cos(x)   # Euler method
      x = x + h
 
Index: pycode-browser/Code/Maths/Calculus/fit1.py
===================================================================
--- pycode-browser.orig/Code/Maths/Calculus/fit1.py
+++ pycode-browser/Code/Maths/Calculus/fit1.py
@@ -17,7 +17,7 @@ y_meas = y_true + 0.2*randn(len(ax))
 
 p0 = [6, 50.0, pi/3]
 plsq = leastsq(err_func,p0,args=(y_meas,ax))
-print plsq
+print( plsq)
 
 plot(ax,y_true)
 plot(ax,y_meas,'o')
Index: pycode-browser/Code/Maths/Calculus/fit2.py
===================================================================
--- pycode-browser.orig/Code/Maths/Calculus/fit2.py
+++ pycode-browser/Code/Maths/Calculus/fit2.py
@@ -16,7 +16,7 @@ y_meas = y_true + 0.2*randn(len(ax))
 
 p0 = [6, 50.0, pi/3]
 plsq = leastsq(err_func,p0,args=(y_meas,ax))
-print plsq
+print( plsq)
 
 plot(ax,y_true)
 plot(ax,y_meas,'o')
Index: pycode-browser/Code/Maths/Calculus/rk4.py
===================================================================
--- pycode-browser.orig/Code/Maths/Calculus/rk4.py
+++ pycode-browser/Code/Maths/Calculus/rk4.py
@@ -18,7 +18,7 @@ x = 0.0     # initail values
 y = 0.0
 
 while x < math.pi:
-     print x, y, math.sin(x)   
+     print( x, y, math.sin(x)   )
      y = rk4(x,y,math.cos)       # Runge-Kutta method
      x = x + h
 
Index: pycode-browser/Code/Maths/Calculus/trapez.py
===================================================================
--- pycode-browser.orig/Code/Maths/Calculus/trapez.py
+++ pycode-browser/Code/Maths/Calculus/trapez.py
@@ -11,7 +11,7 @@ def trapez(f, a, b, n):
 	sum = sum + f(b)
 	return 0.5 * h * sum
 
-print trapez(sin,0.,pi,100)
-print trapez(sqr,0.,2.,100)
-print trapez(sqr,0,2,100)   # Why the error ?
+print( trapez(sin,0.,pi,100))
+print( trapez(sqr,0.,2.,100))
+print( trapez(sqr,0,2,100))   # Why the error ?
 
Index: pycode-browser/Code/Maths/Graphs/sine.py
===================================================================
--- pycode-browser.orig/Code/Maths/Graphs/sine.py
+++ pycode-browser/Code/Maths/Graphs/sine.py
@@ -3,5 +3,5 @@
 import math
 x = 0.0
 while x < math.pi * 4:
-    print x , math.sin(x)
+    print( x , math.sin(x))
     x = x + 0.1
\ No newline at end of file
Index: pycode-browser/Code/Maths/Polynomials/poly.py
===================================================================
--- pycode-browser.orig/Code/Maths/Polynomials/poly.py
+++ pycode-browser/Code/Maths/Polynomials/poly.py
@@ -6,9 +6,9 @@ b = poly1d([6,7])
 c = a * b + 5
 d = c/a
 
-print a
-print b
-print a * b
-print d[0], d[1]
-print a.deriv()
-print a.integ()
+print( a)
+print( b)
+print( a * b)
+print( d[0], d[1])
+print( a.deriv())
+print( a.integ())
Index: pycode-browser/Code/Maths/Polynomials/poly1.py
===================================================================
--- pycode-browser.orig/Code/Maths/Polynomials/poly1.py
+++ pycode-browser/Code/Maths/Polynomials/poly1.py
@@ -2,11 +2,11 @@ import scipy
 import pylab
 
 a = scipy.poly1d([3,4,5])
-print a, ' is the polynomial'
-print a*a, 'is its square'
-print a.deriv(), ' is its derivative'
-print a.integ(), ' is its integral'
-print a(0.5), 'is its value at x = 0.5'
+print( a, ' is the polynomial')
+print( a*a, 'is its square')
+print( a.deriv(), ' is its derivative')
+print( a.integ(), ' is its integral')
+print( a(0.5), 'is its value at x = 0.5')
 
 x = scipy.linspace(0,5,100)
 b = a(x)
Index: pycode-browser/Code/Maths/area.py
===================================================================
--- pycode-browser.orig/Code/Maths/area.py
+++ pycode-browser/Code/Maths/area.py
@@ -3,4 +3,4 @@
 pi = 3.1416
 r = input('Enter Radius ')
 a = pi * r ** 2       #A=\pi r^{2}
-print 'Area = ', a
+print( 'Area = ', a)
Index: pycode-browser/Code/Maths/badtable.py
===================================================================
--- pycode-browser.orig/Code/Maths/badtable.py
+++ pycode-browser/Code/Maths/badtable.py
@@ -1,7 +1,7 @@
 #Example: badtable.py
 
-print 1 * 8
-print 2 * 8
-print 3 * 8
-print 4 * 8
-print 5 * 8
+print( 1 * 8)
+print( 2 * 8)
+print( 3 * 8)
+print( 4 * 8)
+print( 5 * 8)
Index: pycode-browser/Code/Maths/big.py
===================================================================
--- pycode-browser.orig/Code/Maths/big.py
+++ pycode-browser/Code/Maths/big.py
@@ -3,8 +3,8 @@
 x = input('Enter a number ')
 
 if x > 10:
-    print 'Bigger Number'
+    print( 'Bigger Number')
 elif x < 10:
-    print 'Smaller Number'
+    print( 'Smaller Number')
 else:
-    print 'Same Number'
+    print( 'Same Number')
Index: pycode-browser/Code/Maths/big2.py
===================================================================
--- pycode-browser.orig/Code/Maths/big2.py
+++ pycode-browser/Code/Maths/big2.py
@@ -3,7 +3,7 @@
 x = 1
 while x < 11:
     if x < 5:
-        print 'Samll ', x
+        print( 'Samll ', x)
     else:
-        print 'Big ', x
-print 'Done'
+        print( 'Big ', x)
+print( 'Done')
Index: pycode-browser/Code/Maths/big3.py
===================================================================
--- pycode-browser.orig/Code/Maths/big3.py
+++ pycode-browser/Code/Maths/big3.py
@@ -3,9 +3,9 @@
 x = 1
 
 while x < 100:
-   print x
+   print( x)
    if x > 10:
-      print 'Enough of this'
+      print( 'Enough of this')
       break
    x = x  + 1
-print 'Done'
+print( 'Done')
Index: pycode-browser/Code/Maths/cloth.py
===================================================================
--- pycode-browser.orig/Code/Maths/cloth.py
+++ pycode-browser/Code/Maths/cloth.py
@@ -8,5 +8,5 @@ class clothing:
                                 
 cheapblue = clothing('blue', 20.0)
 costlyred = clothing('red', 100.0)
-print cheapblue.rate
-print costlyred
\ No newline at end of file
+print( cheapblue.rate)
+print( costlyred)
\ No newline at end of file
Index: pycode-browser/Code/Maths/cloth2.py
===================================================================
--- pycode-browser.orig/Code/Maths/cloth2.py
+++ pycode-browser/Code/Maths/cloth2.py
@@ -10,5 +10,5 @@ class clothing:
             return '%s Cloth at Rs. %6.2f per sqmtr'%(self.colour, self.rate)
 cheapblue = clothing('blue', 20.0)
 costlyred = clothing('red', 100.0)
-print cheapblue.rate
-print costlyred
\ No newline at end of file
+print( cheapblue.rate)
+print( costlyred)
\ No newline at end of file
Index: pycode-browser/Code/Maths/clothbill.py
===================================================================
--- pycode-browser.orig/Code/Maths/clothbill.py
+++ pycode-browser/Code/Maths/clothbill.py
@@ -42,4 +42,4 @@ items.append(pants(cheapblue, 2.0, 150.0
 items.append(shirt(costlyred, 1.5, 130.0) )
 
 for k in items:
-    print k, k.getcost()
+    print( k, k.getcost())
Index: pycode-browser/Code/Maths/compareEuRK4.py
===================================================================
--- pycode-browser.orig/Code/Maths/compareEuRK4.py
+++ pycode-browser/Code/Maths/compareEuRK4.py
@@ -17,7 +17,7 @@ y = 0.0     # for Euler
 z = 0.0     # for RK4
 
 while x < math.pi:
-     print x, y - math.sin(x), z - math.sin(x) # errors   
+     print( x, y - math.sin(x), z - math.sin(x)) # errors
      y = y + h * math.cos(x)       # Euler method
      z = rk4(x,z,math.cos,h)       # Runge-Kutta method
      x = x + h
Index: pycode-browser/Code/Maths/conflict.py
===================================================================
--- pycode-browser.orig/Code/Maths/conflict.py
+++ pycode-browser/Code/Maths/conflict.py
@@ -2,7 +2,7 @@
 
 from numpy import *
 x = linspace(0, 5, 10) # make a 10 element array
-print sin(x)           # sin of scipy can handle arrays
+print( sin(x))         # sin of scipy can handle arrays
 
 from math import *     # sin of math will be called now
-print sin(x)           # will give ERROR
+print( sin(x) )        # will give ERROR
Index: pycode-browser/Code/Maths/cross.py
===================================================================
--- pycode-browser.orig/Code/Maths/cross.py
+++ pycode-browser/Code/Maths/cross.py
@@ -4,4 +4,4 @@ from numpy import *
 a = array([1,2,3])
 b = array([4,5,6])
 c = cross(a,b)
-print c
+print( c)
Index: pycode-browser/Code/Maths/diff.py
===================================================================
--- pycode-browser.orig/Code/Maths/diff.py
+++ pycode-browser/Code/Maths/diff.py
@@ -7,6 +7,6 @@ def deriv(x,dx=0.005):
         df = f(x+dx/2)-f(x-dx/2)
         return df/dx
 
-print deriv(2.0)
-print deriv(2.0, 0.1)
-print deriv(2.0, 0.0001)
+print( deriv(2.0))
+print( deriv(2.0, 0.1))
+print( deriv(2.0, 0.0001))
Index: pycode-browser/Code/Maths/euler.py
===================================================================
--- pycode-browser.orig/Code/Maths/euler.py
+++ pycode-browser/Code/Maths/euler.py
@@ -5,7 +5,7 @@ x = 0.0     # initail values
 y = 0.0
 
 while x < math.pi:
-     print x, y, math.sin(x)   
+     print( x, y, math.sin(x)   )
      y = y + h * math.cos(x)   # Euler method
      x = x + h
 
Index: pycode-browser/Code/Maths/factor.py
===================================================================
--- pycode-browser.orig/Code/Maths/factor.py
+++ pycode-browser/Code/Maths/factor.py
@@ -5,4 +5,4 @@ def factorial(n): # a recursive function
          return 1 
     else: 
          return n * factorial(n-1) 
-print factorial(10) 
+print( factorial(10) )
Index: pycode-browser/Code/Maths/fileio.py
===================================================================
--- pycode-browser.orig/Code/Maths/fileio.py
+++ pycode-browser/Code/Maths/fileio.py
@@ -4,4 +4,4 @@ from numpy import *
 a = arange(10)
 a.tofile('myfile.dat')
 b = fromfile('myfile.dat')
-print b
+print( b)
Index: pycode-browser/Code/Maths/first.py
===================================================================
--- pycode-browser.orig/Code/Maths/first.py
+++ pycode-browser/Code/Maths/first.py
@@ -13,18 +13,18 @@ In a single line, anything after a # sig
 
 x = 10 
 
-print x, type(x)        #print x and its type
+print( x, type(x) )       #print x and its type
 
 y = 10.4
 
-print y, type(y)
+print( y, type(y))
 
 z = 3 + 4j
 
-print z, type(z)
+print( z, type(z))
 
 s1 = 'I am a String '
 
 s2 = 'me too'
 
-print s1, s2, type(s1)
+print( s1, s2, type(s1))
Index: pycode-browser/Code/Maths/forloop.py
===================================================================
--- pycode-browser.orig/Code/Maths/forloop.py
+++ pycode-browser/Code/Maths/forloop.py
@@ -2,8 +2,8 @@
 
 a = 'my name'
 for ch in a:
-    print ch
+    print( ch)
 
 b = ['hello', 3.4, 2345, 3+5j]
 for item in b:
-    print item
+    print( item)
Index: pycode-browser/Code/Maths/forloop2.py
===================================================================
--- pycode-browser.orig/Code/Maths/forloop2.py
+++ pycode-browser/Code/Maths/forloop2.py
@@ -1,7 +1,7 @@
 #Example: forloop2.py
 
 mylist = range(5)
-print mylist
+print( mylist)
 
 for item in mylist:
-    print item
+    print( item)
Index: pycode-browser/Code/Maths/forloop3.py
===================================================================
--- pycode-browser.orig/Code/Maths/forloop3.py
+++ pycode-browser/Code/Maths/forloop3.py
@@ -2,4 +2,4 @@
 
 mylist = range(5,51,5)
 for item in mylist:
-    print item
+    print( item)
Index: pycode-browser/Code/Maths/forloop4.py
===================================================================
--- pycode-browser.orig/Code/Maths/forloop4.py
+++ pycode-browser/Code/Maths/forloop4.py
@@ -3,5 +3,5 @@ size = len(a)
 for k in range(size):
 	if a[k] < 0:
 		a[k] = 0
-print a
+print( a)
 		
Index: pycode-browser/Code/Maths/format.py
===================================================================
--- pycode-browser.orig/Code/Maths/format.py
+++ pycode-browser/Code/Maths/format.py
@@ -1,5 +1,5 @@
 #Example: format.py
 
 a = 2.0 /3 
-print a
-print 'a = %5.3f' %(a) # upto 3 decimal places
+print( a)
+print( 'a = %5.3f' %(a) ) # upto 3 decimal places
Index: pycode-browser/Code/Maths/format2.py
===================================================================
--- pycode-browser.orig/Code/Maths/format2.py
+++ pycode-browser/Code/Maths/format2.py
@@ -1,7 +1,7 @@
 #Example: format2.py
 
 a = 'justify as you like'
-print '%30s'%a
-print '%-30s'%a        # minus sign for left justification
+print( '%30s'%a)
+print( '%-30s'%a)       # minus sign for left justification
 for k in range(1,11):   # A good looking table
-    print '5 x %2d = %2d' %(k, k*5)
\ No newline at end of file
+    print( '5 x %2d = %2d' %(k, k*5))
Index: pycode-browser/Code/Maths/func.py
===================================================================
--- pycode-browser.orig/Code/Maths/func.py
+++ pycode-browser/Code/Maths/func.py
@@ -3,4 +3,4 @@
 def sum(a,b):    # a trivial function
     return a + b
 
-print sum(3, 4)
+print( sum(3, 4))
Index: pycode-browser/Code/Maths/inv.py
===================================================================
--- pycode-browser.orig/Code/Maths/inv.py
+++ pycode-browser/Code/Maths/inv.py
@@ -3,5 +3,5 @@
 from numpy import *
 a = array([ [4,1,-2], [2,-3,3], [-6,-2,1] ], dtype='float')
 ainv = linalg.inv(a)
-print ainv
-print dot(a,ainv)
+print( ainv)
+print( dot(a,ainv))
Index: pycode-browser/Code/Maths/kin.py
===================================================================
--- pycode-browser.orig/Code/Maths/kin.py
+++ pycode-browser/Code/Maths/kin.py
@@ -2,6 +2,6 @@
 
 x = input('Enter an integer ')
 y = input('Enter one more ')
-print 'The sum is ', x + y
+print( 'The sum is ', x + y)
 s = raw_input('Enter a String ')
-print 'You entered ', s
+print( 'You entered ', s)
Index: pycode-browser/Code/Maths/kin2.py
===================================================================
--- pycode-browser.orig/Code/Maths/kin2.py
+++ pycode-browser/Code/Maths/kin2.py
@@ -1,8 +1,8 @@
 #Example: kin2.py
 
 x,y = input('Enter x and y separated by comma ')
-print 'The sum is ', x + y
+print( 'The sum is ', x + y)
 s = raw_input('Enter a decimal number ')
-print 'Your input string x 2 = ', s
+print( 'Your input string x 2 = ', s)
 a = float(s)
-print a * 2
+print( a * 2)
Index: pycode-browser/Code/Maths/mathlocal.py
===================================================================
--- pycode-browser.orig/Code/Maths/mathlocal.py
+++ pycode-browser/Code/Maths/mathlocal.py
@@ -2,4 +2,4 @@
 
 from math import sin  # sin is imported as local
 
-print sin(0.5)  
+print( sin(0.5)  )
Index: pycode-browser/Code/Maths/mathlocal2.py
===================================================================
--- pycode-browser.orig/Code/Maths/mathlocal2.py
+++ pycode-browser/Code/Maths/mathlocal2.py
@@ -2,4 +2,4 @@
 
 from math import *   # import everything from math
 
-print sin(0.5)
+print( sin(0.5))
Index: pycode-browser/Code/Maths/mathsin.py
===================================================================
--- pycode-browser.orig/Code/Maths/mathsin.py
+++ pycode-browser/Code/Maths/mathsin.py
@@ -2,4 +2,4 @@
 
 import math
 
-print math.sin(0.5) # module_name.method_name 
+print( math.sin(0.5) ) # module_name.method_name
Index: pycode-browser/Code/Maths/mathsin2.py
===================================================================
--- pycode-browser.orig/Code/Maths/mathsin2.py
+++ pycode-browser/Code/Maths/mathsin2.py
@@ -1,4 +1,4 @@
 #Example math2.py
 
 import math as m   # Give another madule name
-print m.sin(0.5)   # Refer by the new name
+print( m.sin(0.5)) # Refer by the new name
Index: pycode-browser/Code/Maths/max.py
===================================================================
--- pycode-browser.orig/Code/Maths/max.py
+++ pycode-browser/Code/Maths/max.py
@@ -7,5 +7,5 @@ while 1:        # Infinite loop
    if x > max:
       max = x
    if x == 0:
-      print max
+      print( max)
       break
Index: pycode-browser/Code/Maths/numpy1.py
===================================================================
--- pycode-browser.orig/Code/Maths/numpy1.py
+++ pycode-browser/Code/Maths/numpy1.py
@@ -2,4 +2,4 @@
 
 from numpy import *
 x = array( [1,2] )   # Make array from list
-print x , type(x)
+print( x , type(x))
Index: pycode-browser/Code/Maths/numpy2.py
===================================================================
--- pycode-browser.orig/Code/Maths/numpy2.py
+++ pycode-browser/Code/Maths/numpy2.py
@@ -3,12 +3,12 @@
 from numpy import *
 
 a = arange(1.0, 2.0, 0.1) # start, stop & step
-print a
+print( a)
 b = linspace(1,2,11) 
-print b
+print( b)
 c = ones(5)         
-print c
+print( c)
 d = zeros(5)
-print d
+print( d)
 e = random.rand(5)
-print e
+print( e)
Index: pycode-browser/Code/Maths/numpy3.py
===================================================================
--- pycode-browser.orig/Code/Maths/numpy3.py
+++ pycode-browser/Code/Maths/numpy3.py
@@ -3,4 +3,4 @@
 from numpy import *
 a = [ [1,2] , [3,4] ] # make a list of lists
 x = array(a)    # and convert to an array
-print a
+print( a)
Index: pycode-browser/Code/Maths/numpy4.py
===================================================================
--- pycode-browser.orig/Code/Maths/numpy4.py
+++ pycode-browser/Code/Maths/numpy4.py
@@ -2,6 +2,6 @@
 
 from numpy import *
 a = arange(10)
-print a
+print( a)
 a = a.reshape(5,2) # 5 rows and 2 columns
-print a
+print( a)
Index: pycode-browser/Code/Maths/numpy5.py
===================================================================
--- pycode-browser.orig/Code/Maths/numpy5.py
+++ pycode-browser/Code/Maths/numpy5.py
@@ -2,7 +2,7 @@
 
 from numpy import *
 a = array([ [1.0, 2.0] , [3.0, 4.0] ]) # make a numpy array
-print a
-print a * 5
-print a * a
-print a / a
+print( a)
+print( a * 5)
+print( a * a)
+print( a / a)
Index: pycode-browser/Code/Maths/oper.py
===================================================================
--- pycode-browser.orig/Code/Maths/oper.py
+++ pycode-browser/Code/Maths/oper.py
@@ -3,5 +3,5 @@
 from numpy import *
 a = array([[2,3], [4,5]])
 b = array([[1,2], [3,0]])
-print a + b
-print a * b
+print( a + b)
+print( a * b)
Index: pycode-browser/Code/Maths/pants.py
===================================================================
--- pycode-browser.orig/Code/Maths/pants.py
+++ pycode-browser/Code/Maths/pants.py
@@ -20,5 +20,5 @@ class pants(clothing):
 
 costlyred = clothing('red', 100.0)
 smallpant = pants(costlyred, 1.5, 100)
-print  smallpant.getcost()
-print smallpant
\ No newline at end of file
+print(  smallpant.getcost())
+print( smallpant)
\ No newline at end of file
Index: pycode-browser/Code/Maths/pickleload.py
===================================================================
--- pycode-browser.orig/Code/Maths/pickleload.py
+++ pycode-browser/Code/Maths/pickleload.py
@@ -3,5 +3,5 @@
 import pickle
 f = open('test.pck' , 'r')
 x = pickle.load(f)
-print x , type(x)        # check the type of data read
+print( x , type(x) )       # check the type of data read
 f.close()
Index: pycode-browser/Code/Maths/poly.py
===================================================================
--- pycode-browser.orig/Code/Maths/poly.py
+++ pycode-browser/Code/Maths/poly.py
@@ -6,9 +6,9 @@ b = poly1d([6,7])
 c = a * b + 5
 d = c/a
 
-print a
-print b
-print a * b
-print d[0], d[1]
-print a.deriv()
-print a.integ()
+print( a)
+print( b)
+print( a * b)
+print( d[0], d[1])
+print( a.deriv())
+print( a.integ())
Index: pycode-browser/Code/Maths/power.py
===================================================================
--- pycode-browser.orig/Code/Maths/power.py
+++ pycode-browser/Code/Maths/power.py
@@ -1,5 +1,5 @@
 def power(mant, exp = 2.0):
     return mant ** exp
     
-print power(5., 3)
-print power(4.)
+print( power(5., 3))
+print( power(4.))
Index: pycode-browser/Code/Maths/reshape.py
===================================================================
--- pycode-browser.orig/Code/Maths/reshape.py
+++ pycode-browser/Code/Maths/reshape.py
@@ -3,4 +3,4 @@
 from numpy import *
 a = arange(20)
 b = reshape(a, [4,5])
-print b
+print( b)
Index: pycode-browser/Code/Maths/rfile.py
===================================================================
--- pycode-browser.orig/Code/Maths/rfile.py
+++ pycode-browser/Code/Maths/rfile.py
@@ -1,5 +1,5 @@
 #Example rfile.py
 
 f = open('test.dat' , 'r')
-print f.read()
+print( f.read())
 f.close()
Index: pycode-browser/Code/Maths/rfile2.py
===================================================================
--- pycode-browser.orig/Code/Maths/rfile2.py
+++ pycode-browser/Code/Maths/rfile2.py
@@ -1,6 +1,6 @@
 #Example rfile2.py
 
 f = open('test.dat' , 'r')
-print f.read(7)      # get first seven characters
-print f.read()       # get the remaining ones
+print( f.read(7))      # get first seven characters
+print( f.read())       # get the remaining ones
 f.close()
Index: pycode-browser/Code/Maths/rfile3.py
===================================================================
--- pycode-browser.orig/Code/Maths/rfile3.py
+++ pycode-browser/Code/Maths/rfile3.py
@@ -7,5 +7,5 @@ while 1: # infinite loop
     if s == '' :    # Empty string means end of file
          break      # terminate the loop
     m = int(s)      # Convert to integer
-    print m * 5     
+    print( m * 5     )
 f.close()
Index: pycode-browser/Code/Maths/rk4.py
===================================================================
--- pycode-browser.orig/Code/Maths/rk4.py
+++ pycode-browser/Code/Maths/rk4.py
@@ -17,7 +17,7 @@ x = 0.0     # initail values
 y = 0.0
 
 while x < math.pi:
-     print x, y, math.sin(x)   
+     print( x, y, math.sin(x)   )
      y = rk4(x,y,math.cos)       # Runge-Kutta method
      x = x + h
 
Index: pycode-browser/Code/Maths/second.py
===================================================================
--- pycode-browser.orig/Code/Maths/second.py
+++ pycode-browser/Code/Maths/second.py
@@ -1,9 +1,9 @@
 #Example: second.py
 
 s = 'My name'
-print s[0]             # will print M
-print s[3]
-print s[-1]            # will print the last element
+print( s[0])             # will print M
+print( s[3])
+print( s[-1])            # will print the last element
 a = [12, 3.4, 'haha']  # List type
-print a, type(a)
-print a[0]
+print( a, type(a))
+print( a[0])
Index: pycode-browser/Code/Maths/sine.py
===================================================================
--- pycode-browser.orig/Code/Maths/sine.py
+++ pycode-browser/Code/Maths/sine.py
@@ -3,5 +3,5 @@
 import math
 x = 0.0
 while x < math.pi * 4:
-    print x , math.sin(x)
+    print( x , math.sin(x))
     x = x + 0.1
\ No newline at end of file
Index: pycode-browser/Code/Maths/table.py
===================================================================
--- pycode-browser.orig/Code/Maths/table.py
+++ pycode-browser/Code/Maths/table.py
@@ -2,5 +2,5 @@
 
 x = 1
 while x <= 10:
-    print x * 8
+    print( x * 8)
     x = x + 1
Index: pycode-browser/Code/Maths/trapez.py
===================================================================
--- pycode-browser.orig/Code/Maths/trapez.py
+++ pycode-browser/Code/Maths/trapez.py
@@ -11,7 +11,7 @@ def trapez(f, a, b, n):
 	sum = sum + f(b)
 	return 0.5 * h * sum
 
-print trapez(sin,0.,pi,100)
-print trapez(sqr,0.,2.,100)
-print trapez(sqr,0,2,100)   # Why the error ?
+print( trapez(sin,0.,pi,100))
+print( trapez(sqr,0.,2.,100))
+print( trapez(sqr,0,2,100))   # Why the error ?
 
Index: pycode-browser/Code/Physics/Quantum/doublewell_asymmetric_multiple.py
===================================================================
--- pycode-browser.orig/Code/Physics/Quantum/doublewell_asymmetric_multiple.py
+++ pycode-browser/Code/Physics/Quantum/doublewell_asymmetric_multiple.py
@@ -37,7 +37,7 @@ a = a/spatial_scaling
 b = b/spatial_scaling
 
 E10 = np.pi*np.pi/2./a  #4.9348022 #(pi^2)/(2*a^2)
-print ('E10 = ',E10)
+print( ('E10 = ',E10))
 energy_scaling = 1./E10  #27.211396
 V0 = 500 #depth of the well
 V0= V0/energy_scaling
@@ -105,7 +105,7 @@ for VL in delta:
 
 	PY = psi[0,:]**2 # +E[0]
 	lbl = 'VL = -%.2e'%(VL)
-	print min(V),E[0],E[1],max(PY[:len(PY)/2]),max(PY[len(PY)/2:])
+	print( min(V),E[0],E[1],max(PY[:len(PY)/2]),max(PY[len(PY)/2:]))
 	if VL==0:
 		ax1.plot(x[::10]*spatial_scaling,PY[::10],color='R',label='symmetric wells')
 	else:
Index: pycode-browser/Code/Physics/fit1.py
===================================================================
--- pycode-browser.orig/Code/Physics/fit1.py
+++ pycode-browser/Code/Physics/fit1.py
@@ -16,7 +16,7 @@ y_meas = y_true + 0.2*randn(len(ax))
 
 p0 = [6, 50.0, pi/3]
 plsq = leastsq(err_func,p0,args=(y_meas,ax))
-print plsq
+print( plsq)
 
 plot(ax,y_true)
 plot(ax,y_meas,'o')
Index: pycode-browser/Code/Physics/fit2.py
===================================================================
--- pycode-browser.orig/Code/Physics/fit2.py
+++ pycode-browser/Code/Physics/fit2.py
@@ -16,7 +16,7 @@ y_meas = y_true + 0.2*randn(len(ax))
 
 p0 = [6, 50.0, pi/3]
 plsq = leastsq(err_func,p0,args=(y_meas,ax))
-print plsq
+print( plsq)
 
 plot(ax,y_true)
 plot(ax,y_meas,'o')
Index: pycode-browser/Code/Physics/numpy1.py
===================================================================
--- pycode-browser.orig/Code/Physics/numpy1.py
+++ pycode-browser/Code/Physics/numpy1.py
@@ -1,8 +1,8 @@
 from numpy import *
 a = array( [ 10, 20, 30, 40 ] )   # create an array out of a list
-print a
-print a * 3
-print a / 3 
+print( a)
+print( a * 3)
+print( a / 3 )
 b = array([1.0, 2.0, 3.0, 4.0])
 c = a + b
 a = array([1,2,3,4], dtype='float')
Index: pycode-browser/Code/Physics/poly1.py
===================================================================
--- pycode-browser.orig/Code/Physics/poly1.py
+++ pycode-browser/Code/Physics/poly1.py
@@ -2,11 +2,11 @@ import scipy
 import pylab
 
 a = scipy.poly1d([3,4,5])
-print a, ' is the polynomial'
-print a*a, 'is its square'
-print a.deriv(), ' is its derivative'
-print a.integ(), ' is its integral'
-print a(0.5), 'is its value at x = 0.5'
+print( a, ' is the polynomial')
+print( a*a, 'is its square')
+print( a.deriv(), ' is its derivative')
+print( a.integ(), ' is its integral')
+print( a(0.5), 'is its value at x = 0.5')
 
 x = scipy.linspace(0,5,100)
 b = a(x)
Index: pycode-browser/Code/Physics/series_sin.py
===================================================================
--- pycode-browser.orig/Code/Physics/series_sin.py
+++ pycode-browser/Code/Physics/series_sin.py
@@ -9,7 +9,7 @@ for n in  range(1,5):
 	sign = (-1)**(n+1)
 	term = x**(2*n-1) / factorial(2*n-1)
 	a = a + sign * term
-	print n,sign
+	print( n,sign)
 	plot(x,term)
 plot(x,a,'+')
 show()
Index: pycode-browser/Code/PythonBook/chap2/area.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/area.py
+++ pycode-browser/Code/PythonBook/chap2/area.py
@@ -3,4 +3,4 @@
 pi = 3.1416
 r = input('Enter Radius ')
 a = pi * r ** 2       #A=\pi r^{2}
-print 'Area = ', a
+print( 'Area = ', a)
Index: pycode-browser/Code/PythonBook/chap2/badtable.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/badtable.py
+++ pycode-browser/Code/PythonBook/chap2/badtable.py
@@ -1,7 +1,7 @@
 #Example: badtable.py
 
-print 1 * 8
-print 2 * 8
-print 3 * 8
-print 4 * 8
-print 5 * 8
+print( 1 * 8)
+print( 2 * 8)
+print( 3 * 8)
+print( 4 * 8)
+print( 5 * 8)
Index: pycode-browser/Code/PythonBook/chap2/big.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/big.py
+++ pycode-browser/Code/PythonBook/chap2/big.py
@@ -3,8 +3,8 @@
 x = input('Enter a number ')
 
 if x > 10:
-    print 'Bigger Number'
+    print( 'Bigger Number')
 elif x < 10:
-    print 'Smaller Number'
+    print( 'Smaller Number')
 else:
-    print 'Same Number'
+    print( 'Same Number')
Index: pycode-browser/Code/PythonBook/chap2/big2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/big2.py
+++ pycode-browser/Code/PythonBook/chap2/big2.py
@@ -3,8 +3,8 @@
 x = 1
 while x < 11:
     if x < 5:
-        print 'Samll ', x
+        print( 'Samll ', x)
     else:
-        print 'Big ', x
+        print( 'Big ', x)
     x = x + 1
-print 'Done'
+print( 'Done')
Index: pycode-browser/Code/PythonBook/chap2/big3.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/big3.py
+++ pycode-browser/Code/PythonBook/chap2/big3.py
@@ -1,13 +1,13 @@
 x = 1
 while x < 10:
    if x < 3:
-       print 'skipping work', x
+       print( 'skipping work', x)
        x = x + 1
        continue
-   print x
+   print( x)
    if x == 4:
-       print 'Enough of work'
+       print( 'Enough of work')
        break
    x = x  + 1
-print 'Done'
+print( 'Done')
 
Index: pycode-browser/Code/PythonBook/chap2/compare.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/compare.py
+++ pycode-browser/Code/PythonBook/chap2/compare.py
@@ -1,4 +1,4 @@
 x = raw_input('Enter a string ')
 if x == 'hello':
-    print 'You typed ', x
+    print( 'You typed ', x)
     
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap2/conflict.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/conflict.py
+++ pycode-browser/Code/PythonBook/chap2/conflict.py
@@ -2,7 +2,7 @@
 
 from numpy import *
 x = linspace(0, 5, 10) # make a 10 element array
-print sin(x)           # sin of scipy can handle arrays
+print( sin(x))         # sin of scipy can handle arrays
 
 from math import *     # sin of math will be called now
-print sin(x)           # will give ERROR
+print( sin(x))         # will give ERROR
Index: pycode-browser/Code/PythonBook/chap2/except.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/except.py
+++ pycode-browser/Code/PythonBook/chap2/except.py
@@ -1,5 +1,5 @@
 x = input('Enter a number ')
 try:
-    print 10.0/x
+    print( 10.0/x)
 except:
-    print 'Division by zero not allowed'
+    print( 'Division by zero not allowed')
Index: pycode-browser/Code/PythonBook/chap2/except2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/except2.py
+++ pycode-browser/Code/PythonBook/chap2/except2.py
@@ -6,6 +6,6 @@ def get_number():
          x = string.atof(a)
          return x
       except:
-         print 'Enter a valid number'
+         print( 'Enter a valid number')
 
-print get_number()
+print( get_number())
Index: pycode-browser/Code/PythonBook/chap2/factor.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/factor.py
+++ pycode-browser/Code/PythonBook/chap2/factor.py
@@ -5,4 +5,4 @@ def factorial(n): # a recursive function
          return 1 
     else: 
          return n * factorial(n-1) 
-print factorial(10) 
+print( factorial(10) )
Index: pycode-browser/Code/PythonBook/chap2/fibanocci.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/fibanocci.py
+++ pycode-browser/Code/PythonBook/chap2/fibanocci.py
@@ -1,7 +1,7 @@
 def fib(n):    # write Fibonacci series up to n
     a, b = 0, 1
     while b < n:
-        print b,
+        print( b,)
         a, b = b, a+b
 
 fib(30)
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap2/first.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/first.py
+++ pycode-browser/Code/PythonBook/chap2/first.py
@@ -13,18 +13,18 @@ In a single line, anything after a # sig
 
 x = 10 
 
-print x, type(x)        #print x and its type
+print( x, type(x))        #print x and its type
 
 y = 10.4
 
-print y, type(y)
+print( y, type(y))
 
 z = 3 + 4j
 
-print z, type(z)
+print( z, type(z))
 
 s1 = 'I am a String '
 
 s2 = 'me too'
 
-print s1, s2, type(s1)
+print( s1, s2, type(s1))
Index: pycode-browser/Code/PythonBook/chap2/forloop.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/forloop.py
+++ pycode-browser/Code/PythonBook/chap2/forloop.py
@@ -2,8 +2,8 @@
 
 a = 'my name'
 for ch in a:
-    print ch
+    print( ch)
 
 b = ['hello', 3.4, 2345, 3+5j]
 for item in b:
-    print item
+    print( item)
Index: pycode-browser/Code/PythonBook/chap2/forloop2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/forloop2.py
+++ pycode-browser/Code/PythonBook/chap2/forloop2.py
@@ -1,7 +1,7 @@
 #Example: forloop2.py
 
 mylist = range(5)
-print mylist
+print( mylist)
 
 for item in mylist:
-    print item
+    print( item)
Index: pycode-browser/Code/PythonBook/chap2/forloop3.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/forloop3.py
+++ pycode-browser/Code/PythonBook/chap2/forloop3.py
@@ -2,4 +2,4 @@
 
 mylist = range(5,51,5)
 for item in mylist:
-    print item ,
+    print( item ,)
Index: pycode-browser/Code/PythonBook/chap2/forloop4.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/forloop4.py
+++ pycode-browser/Code/PythonBook/chap2/forloop4.py
@@ -3,5 +3,5 @@ size = len(a)
 for k in range(size):
 	if a[k] < 0:
 		a[k] = 0
-print a
+print( a)
 		
Index: pycode-browser/Code/PythonBook/chap2/format.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/format.py
+++ pycode-browser/Code/PythonBook/chap2/format.py
@@ -1,5 +1,5 @@
 #Example: format.py
 
 a = 2.0 /3 
-print a
-print 'a = %5.3f' %(a) # upto 3 decimal places
+print( a)
+print( 'a = %5.3f' %(a)) # upto 3 decimal places
Index: pycode-browser/Code/PythonBook/chap2/format2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/format2.py
+++ pycode-browser/Code/PythonBook/chap2/format2.py
@@ -1,7 +1,7 @@
 #Example: format2.py
 
 a = 'justify as you like'
-print '%30s'%a
-print '%-30s'%a        # minus sign for left justification
+print( '%30s'%a)
+print( '%-30s'%a)       # minus sign for left justification
 for k in range(1,11):   # A good looking table
-    print '5 x %2d = %2d' %(k, k*5)
\ No newline at end of file
+    print( '5 x %2d = %2d' %(k, k*5))
Index: pycode-browser/Code/PythonBook/chap2/func.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/func.py
+++ pycode-browser/Code/PythonBook/chap2/func.py
@@ -3,4 +3,4 @@
 def sum(a,b):    # a trivial function
     return a + b
 
-print sum(3, 4)
+print( sum(3, 4))
Index: pycode-browser/Code/PythonBook/chap2/global.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/global.py
+++ pycode-browser/Code/PythonBook/chap2/global.py
@@ -4,4 +4,4 @@ def change(x):
 
 counter = 10      
 change(5)
-print counter
\ No newline at end of file
+print( counter)
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap2/hello.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/hello.py
+++ pycode-browser/Code/PythonBook/chap2/hello.py
@@ -1 +1 @@
-print 'Hello World'
+print( 'Hello World')
Index: pycode-browser/Code/PythonBook/chap2/kin1.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/kin1.py
+++ pycode-browser/Code/PythonBook/chap2/kin1.py
@@ -1,5 +1,5 @@
 x = input('Enter an integer ')
 y = input('Enter one more ')
-print 'The sum is ', x + y
+print( 'The sum is ', x + y)
 s = raw_input('Enter a String ')
-print 'You entered ', s
+print( 'You entered ', s)
Index: pycode-browser/Code/PythonBook/chap2/kin2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/kin2.py
+++ pycode-browser/Code/PythonBook/chap2/kin2.py
@@ -1,6 +1,6 @@
 x,y = input('Enter x and y separated by comma ')
-print 'The sum is ', x + y
+print( 'The sum is ', x + y)
 s = raw_input('Enter a decimal number ')
 a = float(s)
-print s * 2    # prints string twice
-print a * 2    # converted value times 2
+print( s * 2)    # prints string twice
+print( a * 2)    # converted value times 2
Index: pycode-browser/Code/PythonBook/chap2/list1.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/list1.py
+++ pycode-browser/Code/PythonBook/chap2/list1.py
@@ -1,4 +1,4 @@
 a = [3, 3.5, 234]   # make a list
-print a[0]
+print( a[0])
 a[1] = 'haha'       # Change an element
-print a
+print( a)
Index: pycode-browser/Code/PythonBook/chap2/list2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/list2.py
+++ pycode-browser/Code/PythonBook/chap2/list2.py
@@ -1,5 +1,5 @@
 a = [1,2]
-print a * 2
-print a + [3,4]
+print( a * 2)
+print( a + [3,4])
 b = [10, 20, a]
-print b
+print( b)
Index: pycode-browser/Code/PythonBook/chap2/list3.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/list3.py
+++ pycode-browser/Code/PythonBook/chap2/list3.py
@@ -1,5 +1,5 @@
 a = []          # make an empty list
 a.append(3)     # Add an element
 a.insert(0,2.3) # insert 2.3 as first element
-print a, a[0]
-print len(a)
\ No newline at end of file
+print( a, a[0])
+print( len(a))
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap2/list_copy.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/list_copy.py
+++ pycode-browser/Code/PythonBook/chap2/list_copy.py
@@ -1,13 +1,13 @@
 a = [1,2,3,4]
-print a
+print( a)
 b = a
-print a == b
+print( a == b)
 b[0] = 5
-print a
+print( a)
 
 import copy
 c = copy.copy(a)
 c[1] = 100
-print a is c
-print a, c
+print( a is c)
+print( a, c)
 
Index: pycode-browser/Code/PythonBook/chap2/mathlocal.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/mathlocal.py
+++ pycode-browser/Code/PythonBook/chap2/mathlocal.py
@@ -2,4 +2,4 @@
 
 from math import sin  # sin is imported as local
 
-print sin(0.5)  
+print( sin(0.5)  )
Index: pycode-browser/Code/PythonBook/chap2/mathlocal2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/mathlocal2.py
+++ pycode-browser/Code/PythonBook/chap2/mathlocal2.py
@@ -2,4 +2,4 @@
 
 from math import *   # import everything from math
 
-print sin(0.5)
+print( sin(0.5))
Index: pycode-browser/Code/PythonBook/chap2/mathsin.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/mathsin.py
+++ pycode-browser/Code/PythonBook/chap2/mathsin.py
@@ -2,4 +2,4 @@
 
 import math
 
-print math.sin(0.5) # module_name.method_name 
+print( math.sin(0.5)) # module_name.method_name
Index: pycode-browser/Code/PythonBook/chap2/mathsin2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/mathsin2.py
+++ pycode-browser/Code/PythonBook/chap2/mathsin2.py
@@ -1,4 +1,4 @@
 #Example math2.py
 
-import math as m   # Give another madule name
-print m.sin(0.5)   # Refer by the new name
+import math as m     # Give another madule name
+print( m.sin(0.5))   # Refer by the new name
Index: pycode-browser/Code/PythonBook/chap2/max.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/max.py
+++ pycode-browser/Code/PythonBook/chap2/max.py
@@ -7,5 +7,5 @@ while 1:        # Infinite loop
    if x > max:
       max = x
    if x == 0:
-      print max
+      print( max)
       break
Index: pycode-browser/Code/PythonBook/chap2/mutable.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/mutable.py
+++ pycode-browser/Code/PythonBook/chap2/mutable.py
@@ -1,5 +1,5 @@
 s = [3, 3.5, 234]   # make a list
 s[2] = 'haha'       # Change an element
-print s
+print( s)
 x = 'myname'        # String type
 #x[1] = 2            # Will give ERROR
Index: pycode-browser/Code/PythonBook/chap2/named.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/named.py
+++ pycode-browser/Code/PythonBook/chap2/named.py
@@ -1,6 +1,6 @@
 def power(mant = 10.0, exp = 2.0):
     return mant ** exp   
     
-print power(5., 3)
-print power(4.)      # prints 16
-print power(exp=3)   
\ No newline at end of file
+print( power(5., 3))
+print( power(4.))      # prints 16
+print( power(exp=3))
Index: pycode-browser/Code/PythonBook/chap2/oper.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/oper.py
+++ pycode-browser/Code/PythonBook/chap2/oper.py
@@ -1,8 +1,8 @@
 x = 2
 y = 4
-print x + y * 2
+print( x + y * 2)
 s = 'Hello '
-print s + s
-print 3 * s
-print x == y
-print y == 2 * x 
+print( s + s)
+print( 3 * s)
+print( x == y)
+print( y == 2 * x )
Index: pycode-browser/Code/PythonBook/chap2/pickleload.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/pickleload.py
+++ pycode-browser/Code/PythonBook/chap2/pickleload.py
@@ -3,5 +3,5 @@
 import pickle
 f = open('test.pck' , 'r')
 x = pickle.load(f)
-print x , type(x)        # check the type of data read
+print( x , type(x))        # check the type of data read
 f.close()
Index: pycode-browser/Code/PythonBook/chap2/point1.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/point1.py
+++ pycode-browser/Code/PythonBook/chap2/point1.py
@@ -1,12 +1,12 @@
 from point import *
 
 origin = Point()
-print origin
+print( origin)
 p1 = Point(4,4)
 p2 = Point(8,7)
-print p1
-print p2
-print p1 + p2
-print p1 - p2
-print p1.dist()
+print( p1)
+print( p2)
+print( p1 + p2)
+print( p1 - p2)
+print( p1.dist())
 
Index: pycode-browser/Code/PythonBook/chap2/point2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/point2.py
+++ pycode-browser/Code/PythonBook/chap2/point2.py
@@ -3,8 +3,8 @@ from cpoint import *
 p1 = Point(5,5)
 rp1 = colPoint(2,2,'red')
 
-print p1
-print rp1
-print rp1 + p1
-print rp1.dist()
+print( p1)
+print( rp1)
+print( rp1 + p1)
+print( rp1.dist())
 
Index: pycode-browser/Code/PythonBook/chap2/power.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/power.py
+++ pycode-browser/Code/PythonBook/chap2/power.py
@@ -1,5 +1,5 @@
 def power(mant, exp = 2.0):
     return mant ** exp
     
-print power(5., 3)
-print power(4.)
+print( power(5., 3))
+print( power(4.))
Index: pycode-browser/Code/PythonBook/chap2/reverse.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/reverse.py
+++ pycode-browser/Code/PythonBook/chap2/reverse.py
@@ -2,4 +2,4 @@ a = 'abcd'
 b = ''
 for k in range(len(a)):
 	b = b + a[-1-k]
-print b
+print( b)
Index: pycode-browser/Code/PythonBook/chap2/rfile.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/rfile.py
+++ pycode-browser/Code/PythonBook/chap2/rfile.py
@@ -1,5 +1,5 @@
 #Example rfile.py
 
 f = open('test.dat' , 'r')
-print f.read()
+print( f.read())
 f.close()
Index: pycode-browser/Code/PythonBook/chap2/rfile2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/rfile2.py
+++ pycode-browser/Code/PythonBook/chap2/rfile2.py
@@ -1,6 +1,6 @@
 #Example rfile2.py
 
 f = open('test.dat' , 'r')
-print f.read(7)      # get first seven characters
-print f.read()       # get the remaining ones
+print( f.read(7))      # get first seven characters
+print( f.read())       # get the remaining ones
 f.close()
Index: pycode-browser/Code/PythonBook/chap2/rfile3.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/rfile3.py
+++ pycode-browser/Code/PythonBook/chap2/rfile3.py
@@ -7,5 +7,5 @@ while 1: # infinite loop
     if s == '' :    # Empty string means end of file
          break      # terminate the loop
     m = int(s)      # Convert to integer
-    print m * 5     
+    print( m * 5     )
 f.close()
Index: pycode-browser/Code/PythonBook/chap2/scope.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/scope.py
+++ pycode-browser/Code/PythonBook/chap2/scope.py
@@ -3,4 +3,4 @@ def change(x):
 
 counter = 10      
 change(5)
-print counter
\ No newline at end of file
+print( counter)
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap2/slice.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/slice.py
+++ pycode-browser/Code/PythonBook/chap2/slice.py
@@ -1,4 +1,4 @@
 a = 'hello world'
-print a[3:5]
-print a[6:]
-print a[:5]
+print( a[3:5])
+print( a[6:])
+print( a[:5])
Index: pycode-browser/Code/PythonBook/chap2/split.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/split.py
+++ pycode-browser/Code/PythonBook/chap2/split.py
@@ -1,7 +1,7 @@
 s = 'I am a long string'
-print s.split()
+print( s.split())
 a = 'abc.abc.abc'
 aa = a.split('.')
-print aa
+print( aa)
 mm = '+'.join(aa)
-print mm
\ No newline at end of file
+print( mm)
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap2/string.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/string.py
+++ pycode-browser/Code/PythonBook/chap2/string.py
@@ -1,4 +1,4 @@
 s = 'hello world'
-print s[0]             # print first element, h
-print s[1]             # print e
-print s[-1]            # will print the last character
\ No newline at end of file
+print( s[0])             # print first element, h
+print( s[1])             # print e
+print( s[-1])            # will print the last character
Index: pycode-browser/Code/PythonBook/chap2/string2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/string2.py
+++ pycode-browser/Code/PythonBook/chap2/string2.py
@@ -1,5 +1,5 @@
 a = 'hello'+'world'
-print a
+print( a)
 b = 'ha' * 3
-print b
-print a[-1] + b[0]
\ No newline at end of file
+print( b)
+print( a[-1] + b[0])
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap2/stringhelp.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/stringhelp.py
+++ pycode-browser/Code/PythonBook/chap2/stringhelp.py
@@ -1,4 +1,4 @@
 s = 'hello world'
-print len(s)
-print s.upper()
+print( len(s))
+print( s.upper())
 help(str)          # press q to quit help
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap2/submodule.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/submodule.py
+++ pycode-browser/Code/PythonBook/chap2/submodule.py
@@ -1,6 +1,6 @@
 from numpy import *
-print random.normal()
+print( random.normal())
 
 import scipy.special
-print scipy.special.j0(.1)
+print( scipy.special.j0(.1))
 
Index: pycode-browser/Code/PythonBook/chap2/table.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/table.py
+++ pycode-browser/Code/PythonBook/chap2/table.py
@@ -2,5 +2,5 @@
 
 x = 1
 while x <= 10:
-    print x * 8
+    print( x * 8)
     x = x + 1
Index: pycode-browser/Code/PythonBook/chap2/tkbutton.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/tkbutton.py
+++ pycode-browser/Code/PythonBook/chap2/tkbutton.py
@@ -1,7 +1,7 @@
 from Tkinter import *
 
 def hello():
-    print 'hello world'                
+    print( 'hello world'                )
     
 w = Tk()   # Creates the main Graphics window
 b = Button(w, text = 'Click Me', command = hello)
Index: pycode-browser/Code/PythonBook/chap3/aroper.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/aroper.py
+++ pycode-browser/Code/PythonBook/chap3/aroper.py
@@ -3,5 +3,5 @@
 from numpy import *
 a = array([[2,3], [4,5]])
 b = array([[1,2], [3,0]])
-print a + b
-print a * b
+print( a + b)
+print( a * b)
Index: pycode-browser/Code/PythonBook/chap3/array_copy.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/array_copy.py
+++ pycode-browser/Code/PythonBook/chap3/array_copy.py
@@ -1,9 +1,9 @@
 from numpy import *
 a = zeros(3)
-print a
+print( a)
 b = a
 c = a.copy()
 c[0] = 10
-print a, c
+print( a, c)
 b[0] = 10
-print a,c
+print( a,c)
Index: pycode-browser/Code/PythonBook/chap3/cross.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/cross.py
+++ pycode-browser/Code/PythonBook/chap3/cross.py
@@ -4,4 +4,4 @@ from numpy import *
 a = array([1,2,3])
 b = array([4,5,6])
 c = cross(a,b)
-print c
+print( c)
Index: pycode-browser/Code/PythonBook/chap3/fileio.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/fileio.py
+++ pycode-browser/Code/PythonBook/chap3/fileio.py
@@ -2,7 +2,7 @@
 
 from numpy import *
 a = arange(10)
-print a
+print( a)
 a.tofile('myfile.dat')
 b = fromfile('myfile.dat', dtype='int')
-print b
+print( b)
Index: pycode-browser/Code/PythonBook/chap3/inv.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/inv.py
+++ pycode-browser/Code/PythonBook/chap3/inv.py
@@ -3,5 +3,5 @@
 from numpy import *
 a = array([ [4,1,-2], [2,-3,3], [-6,-2,1] ], dtype='float')
 ainv = linalg.inv(a)
-print ainv
-print dot(a,ainv)
+print( ainv)
+print( dot(a,ainv))
Index: pycode-browser/Code/PythonBook/chap3/numpy1.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/numpy1.py
+++ pycode-browser/Code/PythonBook/chap3/numpy1.py
@@ -2,4 +2,4 @@
 
 from numpy import *
 x = array( [1,2] )   # Make array from list
-print x , type(x)
+print( x , type(x))
Index: pycode-browser/Code/PythonBook/chap3/numpy2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/numpy2.py
+++ pycode-browser/Code/PythonBook/chap3/numpy2.py
@@ -3,12 +3,12 @@
 from numpy import *
 
 a = arange(1.0, 2.0, 0.1) # start, stop & step
-print a
+print( a)
 b = linspace(1,2,11) 
-print b
+print( b)
 c = ones(5)         
-print c
+print( c)
 d = zeros(5)
-print d
+print( d)
 e = random.rand(5)
-print e
+print( e)
Index: pycode-browser/Code/PythonBook/chap3/numpy3.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/numpy3.py
+++ pycode-browser/Code/PythonBook/chap3/numpy3.py
@@ -3,4 +3,4 @@
 from numpy import *
 a = [ [1,2] , [3,4] ] # make a list of lists
 x = array(a)    # and convert to an array
-print a
+print( a)
Index: pycode-browser/Code/PythonBook/chap3/numpy4.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/numpy4.py
+++ pycode-browser/Code/PythonBook/chap3/numpy4.py
@@ -2,6 +2,6 @@
 
 from numpy import *
 a = arange(10)
-print a
+print( a)
 a = a.reshape(5,2) # 5 rows and 2 columns
-print a
+print( a)
Index: pycode-browser/Code/PythonBook/chap3/reshape.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/reshape.py
+++ pycode-browser/Code/PythonBook/chap3/reshape.py
@@ -3,4 +3,4 @@
 from numpy import *
 a = arange(20)
 b = reshape(a, [4,5])
-print b
+print( b)
Index: pycode-browser/Code/PythonBook/chap3/sine.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/sine.py
+++ pycode-browser/Code/PythonBook/chap3/sine.py
@@ -3,5 +3,5 @@
 import math
 x = 0.0
 while x < math.pi * 4:
-    print x , math.sin(x)
+    print( x , math.sin(x))
     x = x + 0.1
\ No newline at end of file
Index: pycode-browser/Code/PythonBook/chap3/vectorize.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/vectorize.py
+++ pycode-browser/Code/PythonBook/chap3/vectorize.py
@@ -5,4 +5,4 @@ def spf(x):
 
 vspf = vectorize(spf)
 a = array([1,2,3,4])
-print vspf(a)
+print( vspf(a))
Index: pycode-browser/Code/PythonBook/chap3/vfunc.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap3/vfunc.py
+++ pycode-browser/Code/PythonBook/chap3/vfunc.py
@@ -1,3 +1,3 @@
 from numpy import *
 a = array([1,10,100,1000])
-print log10(a)
+print( log10(a))
Index: pycode-browser/Code/PythonBook/chap4/mgrid1.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap4/mgrid1.py
+++ pycode-browser/Code/PythonBook/chap4/mgrid1.py
@@ -2,5 +2,5 @@ from numpy import *
 x = arange(0, 3, 1)
 y = arange(0, 3, 1)
 gx, gy = meshgrid(x, y)
-print gx
-print gy
+print( gx)
+print( gy)
Index: pycode-browser/Code/PythonBook/chap4/xyplot.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap4/xyplot.py
+++ pycode-browser/Code/PythonBook/chap4/xyplot.py
@@ -9,7 +9,7 @@ while True:
     if len(s) < 3:
        break
     ss = s.split()
-    print ss
+    print( ss)
     x.append(ss[0])
     y.append(ss[1])
 
Index: pycode-browser/Code/PythonBook/chap6/bisection.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/bisection.py
+++ pycode-browser/Code/PythonBook/chap6/bisection.py
@@ -1,28 +1,28 @@
 import math
 def func(x):
-	return x**3 - 10.0* x*x + 5
+        return x**3 - 10.0* x*x + 5
 
 def bisect(f, x1, x2, epsilon=1.0e-9):
     f1 = f(x1)
     f2 = f(x2)
     if f1*f2 > 0.0: 
-	print 'x1 ans x2 are on the same side of x-axis'
-	return None
+        print( 'x1 ans x2 are on the same side of x-axis')
+        return None
     n = math.ceil(math.log(abs(x2 - x1)/epsilon)/math.log(2.0))
     n = int(n)
     for i in range(n):
         x3 = 0.5 * (x1 + x2)
-	f3 = f(x3)
+        f3 = f(x3)
         if f3 == 0.0: return x3
         if f2*f3 < 0.0:
              x1 = x3
-	     f1 = f3
+             f1 = f3
         else:
              x2 =x3
              f2 = f3
     return (x1 + x2)/2.0
 
 
-print bisect(func, 0.70, 0.8, 1.0e-4)
-print bisect(func, 0.70, 0.8, 1.0e-9)
+print( bisect(func, 0.70, 0.8, 1.0e-4))
+print( bisect(func, 0.70, 0.8, 1.0e-9))
 
Index: pycode-browser/Code/PythonBook/chap6/diff.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/diff.py
+++ pycode-browser/Code/PythonBook/chap6/diff.py
@@ -11,9 +11,9 @@ def deriv(func, x, dx=0.1):
         df = func(x+dx/2)-func(x-dx/2)
         return df/dx
 
-print deriv(f1, 1.0), deriv(f1, 1.0, 0.01) 
-print deriv(f2, 1.0), deriv(f2, 1.0, 0.01) 
-print deriv(f3, 1.0), deriv(f3, 1.0, 0.01)
+print( deriv(f1, 1.0), deriv(f1, 1.0, 0.01) )
+print( deriv(f2, 1.0), deriv(f2, 1.0, 0.01) )
+print( deriv(f3, 1.0), deriv(f3, 1.0, 0.01))
 
  
 
Index: pycode-browser/Code/PythonBook/chap6/lsfit.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/lsfit.py
+++ pycode-browser/Code/PythonBook/chap6/lsfit.py
@@ -9,7 +9,7 @@ xbar = mean(x)
 ybar = mean(data)
 b = sum(data*(x-xbar)) / sum(x*(x-xbar))
 a = ybar - xbar * b
-print a,b
+print( a,b)
 
 y = a + b * x
 plot(x,y)
Index: pycode-browser/Code/PythonBook/chap6/newpoly.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/newpoly.py
+++ pycode-browser/Code/PythonBook/chap6/newpoly.py
@@ -12,6 +12,6 @@ def coef(x,y):
 
 x  = [0,1,2,3]
 y  = [0,3,14,39]
-print coef(x,y)
+print( coef(x,y))
 
 
Index: pycode-browser/Code/PythonBook/chap6/newpoly2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/newpoly2.py
+++ pycode-browser/Code/PythonBook/chap6/newpoly2.py
@@ -9,5 +9,5 @@ def coef(x,y):
 
 x  = array([0,1,2,3])
 y  = array([0,3,14,39])
-print coef(x,y)
+print( coef(x,y))
 
Index: pycode-browser/Code/PythonBook/chap6/newraph.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/newraph.py
+++ pycode-browser/Code/PythonBook/chap6/newraph.py
@@ -9,11 +9,11 @@ def df(x):
 def nr(x, tol = 1.0e-9):
 	for i in range(30):
 		dx = -f(x)/df(x)
-		#print x
+		#print( x)
 		x = x + dx
 		if abs(dx) < tol: 
 			return x
 
-print nr(4)
-print nr(1)
-print nr(-4)
+print( nr(4))
+print( nr(1))
+print( nr(-4))
Index: pycode-browser/Code/PythonBook/chap6/poly.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/poly.py
+++ pycode-browser/Code/PythonBook/chap6/poly.py
@@ -6,11 +6,11 @@ b = poly1d([6,7])
 c = a * b + 5
 d = c/a
 
-print a
-print a(0.5)
-print b
-print a * b
-print a.deriv()
-print a.integ()
-print d[0], d[1]
+print( a)
+print( a(0.5))
+print( b)
+print( a * b)
+print( a.deriv())
+print( a.integ())
+print( d[0], d[1])
 
Index: pycode-browser/Code/PythonBook/chap6/rk4_proper.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/rk4_proper.py
+++ pycode-browser/Code/PythonBook/chap6/rk4_proper.py
@@ -18,17 +18,17 @@ def rk4(x, y, fxy, h):   # x, y , f(x,y)
 	k3 = h * fxy(x + h/2.0, y+k2/2)
 	k4 = h * fxy(x + h, y+k3)
 	ny = y + ( k1/6 + k2/3 + k3/3 + k4/6 )
-	#print x,y,k1,k2,k3,k4, ny
+	#print( x,y,k1,k2,k3,k4, ny)
 	return ny
 
 
 h = 0.2   # stepsize
 x = 0.0   # initail values
 y = 0.0
-print rk4(x,y,f1,h) 
+print( rk4(x,y,f1,h) )
 
 h = 1    # stepsize
 x = 0.0    # initail values
 y = 1.0
-print rk4(x,y,f2,h) 
+print( rk4(x,y,f2,h) )
 
Index: pycode-browser/Code/PythonBook/chap6/rootsearch.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/rootsearch.py
+++ pycode-browser/Code/PythonBook/chap6/rootsearch.py
@@ -1,20 +1,20 @@
 import math
 def func(x):
-	return x**3 - 10.0* x*x + 5
+        return x**3 - 10.0* x*x + 5
 
 def rootsearch(f,a,b,dx):
     x = a
     while True:
-	f1 = f(x)
-	f2 = f(x+dx)
-	if f1*f2 < 0:
-		return x, x + dx
-	x = x + dx
-	if x >=  b: 
-		print 'Failed to find root'
-		return
+        f1 = f(x)
+        f2 = f(x+dx)
+        if f1*f2 < 0:
+                return x, x + dx
+        x = x + dx
+        if x >=  b: 
+                print( 'Failed to find root')
+                return
 
 x,y = rootsearch(func, 0.0,1.0,.1)
-print x,y
+print( x,y)
 x,y = rootsearch(math.cos, 0.0, 4,.1)
-print x,y
+print( x,y)
Index: pycode-browser/Code/PythonBook/chap6/solve_eqn.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/solve_eqn.py
+++ pycode-browser/Code/PythonBook/chap6/solve_eqn.py
@@ -1,4 +1,4 @@
 from numpy import *
 b = array([0,9,0])
 A = array([ [4,1,-2], [2,-3,3],[-6,-2,1]])
-print dot(linalg.inv(A),b)
+print( dot(linalg.inv(A),b))
Index: pycode-browser/Code/PythonBook/chap6/taylor.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/taylor.py
+++ pycode-browser/Code/PythonBook/chap6/taylor.py
@@ -10,6 +10,6 @@ x = 0
 while x < .5:
 	tay = p(a) + (x-a)* dp(a) + \
          (x-a)**2 * dp2(a) / 2 + (x-a)**3 * dp3(a)/6
-	print '%5.1f  %8.5f\t%8.5f'%(x, p(x), tay)
+	print( '%5.1f  %8.5f\t%8.5f'%(x, p(x), tay))
 	x = x + .1
 
Index: pycode-browser/Code/PythonBook/chap6/trapez.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap6/trapez.py
+++ pycode-browser/Code/PythonBook/chap6/trapez.py
@@ -1,17 +1,17 @@
 from math import *
 
 def sqr(a):
-	return sqrt(1.0 - a**2)
+        return sqrt(1.0 - a**2)
 
 def trapez(f, a, b, n):
-	h = (b-a) / n
-	sum = f(a)
-	for i in range (1,n):
-		sum = sum + 2 * f(a + h * i)
-	sum = sum + f(b)
-	return 0.5 * h * sum
+        h = (b-a) / n
+        sum = f(a)
+        for i in range (1,n):
+                sum = sum + 2 * f(a + h * i)
+        sum = sum + f(b)
+        return 0.5 * h * sum
 
-print 4*trapez(sqr,0.,1.,100)
-print 4*trapez(sqr,0.,1.,1000)
-print 4*trapez(sqr,0,1,100)   # Why the error ?
+print( 4*trapez(sqr,0.,1.,100))
+print( 4*trapez(sqr,0.,1.,1000))
+print( 4*trapez(sqr,0,1,100))   # Why the error ?
 
Index: pycode-browser/Code/Maths/julia.py
===================================================================
--- pycode-browser.orig/Code/Maths/julia.py
+++ pycode-browser/Code/Maths/julia.py
@@ -24,16 +24,16 @@ def numit(x,y):       # number of iterat
      z = complex(x,y)
      for k in range(MAXIT):
             if abs(z) <= MAXABS:
-	        z = z**2 + c         
+                 z = z**2 + c         
             else:
-		return k     # diverged after k trials
+                 return k     # diverged after k trials
      return MAXIT            # did not diverge,
 
 for x in range(X):
     for y in range(Y):
-	re = rscale * x - rlim  # complex number represented
-	im = iscale * y - ilim	# by the (x,y) coordinate
-        m[x][y] = numit(re,im)  # get the color for (x,y)
+         re = rscale * x - rlim  # complex number represented
+         im = iscale * y - ilim    # by the (x,y) coordinate
+         m[x][y] = numit(re,im)  # get the color for (x,y)
 
 imshow(m)  # Colored plot using the two dimensional matrix
 show()
Index: pycode-browser/Code/Maths/Graphs/julia.py
===================================================================
--- pycode-browser.orig/Code/Maths/Graphs/julia.py
+++ pycode-browser/Code/Maths/Graphs/julia.py
@@ -24,16 +24,16 @@ def numit(x,y):       # number of iterat
      z = complex(x,y)
      for k in range(MAXIT):
             if abs(z) <= MAXABS:
-	        z = z**2 + c         
+                 z = z**2 + c         
             else:
-		return k     # diverged after k trials
+                 return k     # diverged after k trials
      return MAXIT            # did not diverge,
 
 for x in range(X):
     for y in range(Y):
-	re = rscale * x - rlim  # complex number represented
-	im = iscale * y - ilim	# by the (x,y) coordinate
-        m[x][y] = numit(re,im)  # get the color for (x,y)
+         re = rscale * x - rlim  # complex number represented
+         im = iscale * y - ilim  # by the (x,y) coordinate
+         m[x][y] = numit(re,im)  # get the color for (x,y)
 
 imshow(m)  # Colored plot using the two dimensional matrix
 show()
Index: pycode-browser/Code/PythonBook/chap2/draw.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/draw.py
+++ pycode-browser/Code/PythonBook/chap2/draw.py
@@ -21,62 +21,62 @@ class disp:
     markertext = None
        
     def __init__(self, parent, width=400., height=100.,color = 'ivory'):
-	self.parent = parent
-	self.SCX = width 
-	self.SCY = height
-	self.plotbg = color
-	f = Frame(parent, bg = self.bgcolor, borderwidth = self.pad)
-	f.pack(side=TOP)
-	self.yaxis = Canvas(f, width = AXWIDTH, height = height, bg = self.bgcolor)
-	self.yaxis.pack(side = LEFT, anchor = N, pady = self.border)
-	f1 = Frame(f)
-	f1.pack(side=LEFT)
-	self.canvas = Canvas(f1, background = self.plotbg, width = width, height = height)
-	self.canvas.pack(side = TOP)
+        self.parent = parent
+        self.SCX = width 
+        self.SCY = height
+        self.plotbg = color
+        f = Frame(parent, bg = self.bgcolor, borderwidth = self.pad)
+        f.pack(side=TOP)
+        self.yaxis = Canvas(f, width = AXWIDTH, height = height, bg = self.bgcolor)
+        self.yaxis.pack(side = LEFT, anchor = N, pady = self.border)
+        f1 = Frame(f)
+        f1.pack(side=LEFT)
+        self.canvas = Canvas(f1, background = self.plotbg, width = width, height = height)
+        self.canvas.pack(side = TOP)
         self.canvas.bind("<Button-1>", self.show_xy)
-	self.xaxis = Canvas(f1, width = width, height = AXWIDTH, bg = self.bgcolor)
-	self.xaxis.pack(side = LEFT, anchor = N, padx = self.border)
-	self.canvas.create_rectangle ([(1,1),(width,height)], outline = self.bordcol)
-	self.canvas.pack()
-	Canvas(f, width = AXWIDTH, height = height, bg = self.bgcolor).pack(side=LEFT) # spacer only
-	self.setWorld(0 , 0, self.SCX, self.SCY)   # initialize scale factors 
-	self.grid(10,100)
+        self.xaxis = Canvas(f1, width = width, height = AXWIDTH, bg = self.bgcolor)
+        self.xaxis.pack(side = LEFT, anchor = N, padx = self.border)
+        self.canvas.create_rectangle ([(1,1),(width,height)], outline = self.bordcol)
+        self.canvas.pack()
+        Canvas(f, width = AXWIDTH, height = height, bg = self.bgcolor).pack(side=LEFT) # spacer only
+        self.setWorld(0 , 0, self.SCX, self.SCY)   # initialize scale factors 
+        self.grid(10,100)
 
     def setWorld(self, x1, y1, x2, y2):   #Calculates the scale factors 
-	self.xmin = float(x1)
-	self.ymin = float(y1)
-	self.xmax = float(x2)
-	self.ymax = float(y2)
-	self.xscale = (self.xmax - self.xmin) / (self.SCX)
-	self.yscale = (self.ymax - self.ymin) / (self.SCY)
+        self.xmin = float(x1)
+        self.ymin = float(y1)
+        self.xmax = float(x2)
+        self.ymax = float(y2)
+        self.xscale = (self.xmax - self.xmin) / (self.SCX)
+        self.yscale = (self.ymax - self.ymin) / (self.SCY)
       
-    def w2s(self, p):	      # World to Screen xy conversion before plotting anything
-	ip = []
-	for xy in p:
-		ix = self.border + int( (xy[0] - self.xmin) / self.xscale)
-		iy = self.border + int( (xy[1] - self.ymin) / self.yscale)
-		iy = self.SCY - iy
-		ip.append((ix,iy))
-	return ip
+    def w2s(self, p):              # World to Screen xy conversion before plotting anything
+        ip = []
+        for xy in p:
+                ix = self.border + int( (xy[0] - self.xmin) / self.xscale)
+                iy = self.border + int( (xy[1] - self.ymin) / self.yscale)
+                iy = self.SCY - iy
+                ip.append((ix,iy))
+        return ip
 
     def show_xy(self,event):   #Prints the XY coordinates of the current cursor position
-	ix = self.canvas.canvasx(event.x) - self.border
-	iy = self.SCY - self.canvas.canvasy(event.y) #- self.border
-	x = ix * self.xscale + self.xmin
-	y = iy * self.yscale + self.ymin
-	s = 'x = %5.3f\ny = %5.3f' % (x,y)
-	try:
-		self.canvas.delete(self.markertext)
-	except:
-		pass
-	self.markertext = self.canvas.create_text(self.border + 1,\
-	self.SCY-1, anchor = SW, justify = LEFT, text = s)
-	self.markerval = [x,y]
+        ix = self.canvas.canvasx(event.x) - self.border
+        iy = self.SCY - self.canvas.canvasy(event.y) #- self.border
+        x = ix * self.xscale + self.xmin
+        y = iy * self.yscale + self.ymin
+        s = 'x = %5.3f\ny = %5.3f' % (x,y)
+        try:
+                self.canvas.delete(self.markertext)
+        except:
+                pass
+        self.markertext = self.canvas.create_text(self.border + 1,\
+        self.SCY-1, anchor = SW, justify = LEFT, text = s)
+        self.markerval = [x,y]
 
     def mark_axes(self, xlab='milli seconds', ylab='mV', numchans=1):
-	# Draw the axis labels and values
+        # Draw the axis labels and values
         numchans = 1
-        for t in self.xtext:	# display after dividing by scale factors
+        for t in self.xtext:        # display after dividing by scale factors
             self.xaxis.delete(t)
         for t in self.ytext:
             self.yaxis.delete(t)
@@ -97,7 +97,7 @@ class disp:
             
         dy = float(self.SCY)/5
         for y in range(0,6):
-            a = y*(self.ymax - self.ymin)/5	# + self.ymin
+            a = y*(self.ymax - self.ymin)/5        # + self.ymin
             if self.ymax > 99:
                 s = '%4.0f'%(self.ymax-a)
             else:
@@ -141,8 +141,8 @@ class disp:
 #------------------------------- disp class end --------------------------------------
 root = Tk()
 
-for k in range(3):					
-	w = disp(root, width=400, height=100)
-	w.setWorld(0, 0, 100, 100)
-	w.mark_axes('X','Y')
+for k in range(3):                                        
+        w = disp(root, width=400, height=100)
+        w.setWorld(0, 0, 100, 100)
+        w.mark_axes('X','Y')
 root.mainloop()
Index: pycode-browser/Code/PythonBook/chap2/tkplot_class.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap2/tkplot_class.py
+++ pycode-browser/Code/PythonBook/chap2/tkplot_class.py
@@ -9,30 +9,30 @@ class disp:
     traces = []
        
     def __init__(self, parent, width=400., height=200.):
-	self.parent = parent
-	self.SCX = width 
-	self.SCY = height
-	self.border = 1
-	self.canvas = Canvas(parent, width=width, height=height)
-	self.canvas.pack(side = LEFT)
-	self.setWorld(0 , 0, self.SCX, self.SCY)   # initialize scale factors 
+        self.parent = parent
+        self.SCX = width 
+        self.SCY = height
+        self.border = 1
+        self.canvas = Canvas(parent, width=width, height=height)
+        self.canvas.pack(side = LEFT)
+        self.setWorld(0 , 0, self.SCX, self.SCY)   # initialize scale factors 
 
     def setWorld(self, x1, y1, x2, y2):   #Calculates the scale factors 
-	self.xmin = float(x1)
-	self.ymin = float(y1)
-	self.xmax = float(x2)
-	self.ymax = float(y2)
-	self.xscale = (self.xmax - self.xmin) / (self.SCX)
-	self.yscale = (self.ymax - self.ymin) / (self.SCY)
+        self.xmin = float(x1)
+        self.ymin = float(y1)
+        self.xmax = float(x2)
+        self.ymax = float(y2)
+        self.xscale = (self.xmax - self.xmin) / (self.SCX)
+        self.yscale = (self.ymax - self.ymin) / (self.SCY)
       
-    def w2s(self, p):	      # World to Screen xy conversion before plotting anything
-	ip = []
-	for xy in p:
-		ix = self.border + int( (xy[0] - self.xmin) / self.xscale)
-		iy = self.border + int( (xy[1] - self.ymin) / self.yscale)
-		iy = self.SCY - iy
-		ip.append((ix,iy))
-	return ip
+    def w2s(self, p):              # World to Screen xy conversion before plotting anything
+        ip = []
+        for xy in p:
+                ix = self.border + int( (xy[0] - self.xmin) / self.xscale)
+                iy = self.border + int( (xy[1] - self.ymin) / self.yscale)
+                iy = self.SCY - iy
+                ip.append((ix,iy))
+        return ip
 
     def line(self, points, col='blue'):
        ip = self.w2s(points)
Index: pycode-browser/Code/PythonBook/chap4/julia.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap4/julia.py
+++ pycode-browser/Code/PythonBook/chap4/julia.py
@@ -24,15 +24,15 @@ def numit(x,y):       # number of iterat
      z = complex(x,y)
      for k in range(MAXIT):
             if abs(z) <= MAXABS:
-	        z = z**2 + c         
+                z = z**2 + c         
             else:
-		return k     # diverged after k trials
+                return k     # diverged after k trials
      return MAXIT            # did not diverge,
 
 for x in range(X):
     for y in range(Y):
-	re = rscale * x - rlim  # complex number represented
-	im = iscale * y - ilim	# by the (x,y) coordinate
+        re = rscale * x - rlim  # complex number represented
+        im = iscale * y - ilim  # by the (x,y) coordinate
         m[x][y] = numit(re,im)  # get the color for (x,y)
 
 imshow(m)  # Colored plot using the two dimensional matrix
Index: pycode-browser/Code/PythonBook/chap4/subplot2.py
===================================================================
--- pycode-browser.orig/Code/PythonBook/chap4/subplot2.py
+++ pycode-browser/Code/PythonBook/chap4/subplot2.py
@@ -6,10 +6,10 @@ NC = 3  # number of columns
 pn = 1
 for row in range(NR):
    for col in range(NC):
-	subplot(NR, NC, pn) 
-	a = rand(10) * pn
-	plot(a, marker = mark[(pn+1)%5])
-	xlabel('plot %d X'%pn)
-	ylabel('plot %d Y'%pn)
-	pn = pn + 1
+        subplot(NR, NC, pn) 
+        a = rand(10) * pn
+        plot(a, marker = mark[(pn+1)%5])
+        xlabel('plot %d X'%pn)
+        ylabel('plot %d Y'%pn)
+        pn = pn + 1
 show()
