2016-05-04 17 views

答えて

0

このパープルの場合、PyQtを使用できます。いくつかの使用例:

import sys 
from PyQt4.QtCore import * 
from PyQt4.QtGui import * 

if __name__ == "__main__": 

    app = QApplication(sys.argv) 

    if len(app.arguments()) < 1: 

     sys.stderr.write("Usage: %s <image file> \n" % sys.argv[0]) 
     sys.exit(1) 

    image = QImage(app.arguments()[1]) 
    if image.isNull(): 
     sys.stderr.write("Failed to read image: %s\n" % app.arguments()[1]) 
     sys.exit(1) 

    label = QLabel() 
    label.setPixmap(QPixmap.fromImage(image)) 
    label.show() 
    sys.exit(app.exec_()) 
関連する問題