Python Study:GUI-Tkinter
生活随笔
收集整理的這篇文章主要介紹了
Python Study:GUI-Tkinter
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
code example
- GUI-Tkinter
- 窗口固定位置載入圖片
GUI-Tkinter
窗口固定位置載入圖片
from tkinter import * import tkinter from PIL import Image, ImageTktop = tkinter.Tk() top.title = 'new' top.geometry("800x600") top.resizable(width=True, height=True)def showImg():load = Image.open("C:\\Users\\Elinker Electric 001\\Desktop\\test\\test.jpg")render = ImageTk.PhotoImage(load)img = tkinter.Label(image=render)img.image = renderimg.place(x=70, y=50)submit_button = tkinter.Button(top, text="顯示圖片", command=lambda: showImg()).place(x=350,y=550)top.mainloop()總結
以上是生活随笔為你收集整理的Python Study:GUI-Tkinter的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: TypeError: rectangle
- 下一篇: yolov配置之:cuda、 cudnn