~osomon/pyexiv2/py3k

« back to all changes in this revision

Viewing changes to src/pyqt-example.py

  • Committer: Olivier Tilloy
  • Date: 2011-10-29 21:53:05 UTC
  • Revision ID: olivier@tilloy.net-20111029215305-6ksbxt0rqrfpemge
Update the syntax of print to be compatible with Python 3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    It is of course assumed that you have PyQt4 installed.
43
43
    """
44
44
    if (len(sys.argv) != 2):
45
 
        print 'Usage: ' + sys.argv[0] + ' path/to/picture/file/containing/jpeg/thumbnail'
 
45
        print('Usage: %s path/to/picture/file/containing/jpeg/thumbnail' % sys.argv[0])
46
46
        sys.exit(1)
47
47
 
48
48
    app = QtGui.QApplication([])
52
52
    metadata.read()
53
53
    previews = metadata.previews
54
54
    if not previews:
55
 
        print "This image doesn't contain any thumbnail."
 
55
        print("This image doesn't contain any thumbnail.")
56
56
        sys.exit(1)
57
57
 
58
58
    # Get the largest preview available