노는게 제일 좋습니다.

Tkinter How to use grid for PhotoImage 본문

Python/기타 공부

Tkinter How to use grid for PhotoImage

노는게 제일 좋습니다. 2016. 9. 4. 17:02

If you write code like this, error occurs.

[code]

img = PhotoImage(file ='test.gif')

img.grid(row=0, column=0)


[error]
AttributeError: 'PhotoImage' object has no attribute 'grid'   

image.grid(row=0, column=0) 

File "C:\Users\studioplug\Desktop\aa.py", line 28, in <module>Traceback (most recent call last):


According my trying, PhotoImage object should be used by attribute of Label.

src_img = PhotoImage(file ='test.gif')
image = Label(master, image = src_img)

image.grid(row=0, column=0)


'Python > 기타 공부' 카테고리의 다른 글

Tkinter tutorial(link)  (0) 2016.09.04
Tkinter PhotoImage resize  (1) 2016.09.04
tkinter grid method  (0) 2016.09.04
tkinter 처음하기  (0) 2016.09.03
python two-dimensional array  (0) 2016.08.21
Comments