|
|
ÂíÉÏ×¢²á£¬½á½»¸ü¶àºÃÓÑ£¬ÏíÓøü¶à¹¦ÄÜ^_^
ÄúÐèÒª µÇ¼ ²Å¿ÉÒÔÏÂÔØ»ò²é¿´£¬Ã»ÓÐÕ˺ţ¿Á¢¼´×¢²á
x
±¾Ìû×îºóÓÉ dragenix ÓÚ 2019-8-13 11:53 ±à¼
from tkinter import *
root = Tk()
textLabel = Label(root,
text = "»¥ÁªÍøµÄÅóÓÑ´ó¼ÒºÃ,\n»¶ÓÄãÀ´µ½ÕâÀï",
justify = LEFT,
padx = 10
)
textLabel.pack(side = LEFT)
photo = PhotoImage(file = "E:\\CGStudy\\python\\0813\\cat_500_600.jpg")
imgLabel = Label(root, image = photo)
imgLabel.pack(side = RIGHT)
mainloop()
===================== RESTART: E:/CGStudy/python/P66.py =====================
Traceback (most recent call last):
File "E:/CGStudy/python/P66.py", line 13, in <module>
photo = PhotoImage(file = "E:\\CGStudy\\python\\cat_500_600.jpg")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 3545, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 3501, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize data in image file "E:\CGStudy\python\cat_500_600.jpg" |
|