pygame / examples / arraydemo.py

Diff from to

examples/arraydemo.py

     from pygame import surfarray
     from pygame.locals import *
 except ImportError:
-    raise ImportError, 'Error Importing Pygame/surfarray'
+    raise ImportError('Error Importing Pygame/surfarray')
 
 main_dir = os.path.split(os.path.abspath(__file__))[0]
 
         elif 'numeric' in surfarray.get_arraytype():
             surfarray.use_arraytype('numeric')
         else:
-            raise ImportError, 'No array package is installed'
+            raise ImportError('No array package is installed')
     else:
         surfarray.use_arraytype(arraytype)
 
         from Numeric import Int32 as int32
 
     pygame.init()
-    print 'Using', surfarray.get_arraytype().capitalize()
-    print 'Press the mouse button to advance image.'
-    print 'Press the "s" key to save the current image.'
+    print ('Using %s' % surfarray.get_arraytype().capitalize())
+    print ('Press the mouse button to advance image.')
+    print ('Press the "s" key to save the current image.')
 
     def surfdemo_show(array_img, name):
         "displays a surface, waits for user to continue"
                 #pygame.image.save(s, name+'.tga')
                 pygame.image.save(screen, name+'.png')
             elif e.type == QUIT:
-                raise SystemExit
+                raise SystemExit()
 
     #allblack
     allblack = N.zeros((128, 128), int32)
     pygame.quit()
 
 def usage():
-    print "Usage: command line option [--numpy|--numeric]"
-    print "  The default is to use NumPy if installed,"
-    print "  otherwise Numeric"
+    print ("Usage: command line option [--numpy|--numeric]")
+    print ("  The default is to use NumPy if installed,")
+    print ("  otherwise Numeric")
 
 if __name__ == '__main__':
     if len(sys.argv) == 2:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.