2011-03-16 35 views
13
def show(): 

    file = raw_input("What is the name of the image file? ") 

    picture = Image(file) 

    width, height = picture.size() 

    pix = picture.getPixels() 

Bu resmi görüntülemek için kod yazmayı deniyorum ancak bu kod görüntüyü sağlamaz. Bu resmi görüntülemek için kodum nasıl değiştirilir?Python'da jpg dosyası nasıl görüntülenir?

+1

diğer ondan yarar olabilir böylece soru için kabul edilen bir yanıt seçmeyi unutmayın de. – tiagoboldt

+0

Lütfen arayınız. Lütfen. Bu yinelenen bir soru. Bunların hepsi alakalı. http://stackoverflow.com/search?q=python+display+image –

cevap

29
import Image 

image = Image.open('File.jpg') 
image.show() 
+1

bu sadece bir harici görüntüleyici uygulaması başlattı – endolith

15

bu kullanmak göstermek için

import Image 

eklemeyi unutmayın :

Image.open('pathToFile').show() 
+1

ikinci sırada thumps up – easymoden00b

İlgili konular