pygame / examples / scaletest.py

Diff from to

examples/scaletest.py

 
 
 def SpeedTest(image):
-    print "Smoothscale Speed Test - Image Size %s\n" % str(image.get_size())
+    print ("Smoothscale Speed Test - Image Size %s\n" % str(image.get_size()))
     imgsize = [image.get_width(), image.get_height()]
     duration = 0.0
     for i in range(128):
         tempimg = pygame.transform.smoothscale(image, (shrinkx, shrinky))
         duration += (time.time() - start)
         del tempimg
-    print "Average smooth shrink time: %i milliseconds." % int((duration / 128) * 1000)
+    print ("Average smooth shrink time: %i milliseconds." % int((duration / 128) * 1000))
     duration = 0
     for i in range(128):
         expandx = (imgsize[0] * (i + 129)) / 128
         tempimg = pygame.transform.smoothscale(image, (expandx, expandy))
         duration += (time.time() - start)
         del tempimg
-    print "Average smooth expand time: %i milliseconds." % int((duration / 128) * 1000)
+    print ("Average smooth expand time: %i milliseconds." % int((duration / 128) * 1000))
     duration = 0.0
     for i in range(128):
         shrinkx = (imgsize[0] * i) / 128
         tempimg = pygame.transform.scale(image, (shrinkx, shrinky))
         duration += (time.time() - start)
         del tempimg
-    print "Average jaggy shrink time: %i milliseconds." % int((duration / 128) * 1000)
+    print ("Average jaggy shrink time: %i milliseconds." % int((duration / 128) * 1000))
     duration = 0
     for i in range(128):
         expandx = (imgsize[0] * (i + 129)) / 128
         tempimg = pygame.transform.scale(image, (expandx, expandy))
         duration += (time.time() - start)
         del tempimg
-    print "Average jaggy expand time: %i milliseconds." % int((duration / 128) * 1000)
+    print ("Average jaggy expand time: %i milliseconds." % int((duration / 128) * 1000))
 
 
 
 if __name__ == '__main__':
     # check input parameters
     if len(sys.argv) < 2:
-        print"Usage: %s ImageFile [-t] [-convert_alpha]" % sys.argv[0]
-        print"       [-t] = Run Speed Test\n"
-        print"       [-convert_alpha] = Use convert_alpha() on the surf.\n"
+        print ("Usage: %s ImageFile [-t] [-convert_alpha]" % sys.argv[0])
+        print ("       [-t] = Run Speed Test\n")
+        print ("       [-convert_alpha] = Use convert_alpha() on the surf.\n")
     else:
         main(sys.argv[1],
              convert_alpha = '-convert_alpha' in sys.argv,
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.