tk.Button

https://pythonguides.com/python-tkinter-save-text-to-file/

from tkinter import *
from tkinter.ttk import *
ws = Tk()
ws.title("Python Guides")
ws.geometry("500x300")
filepath=f"D:\linbo.yang\study\python\idle\idle-master\Icons\python.gif"
image = PhotoImage(file=filepath)

ws.iconphoto(False, image)

button = Button(ws, text='Click Me !',image=image,compound=RIGHT)
button.pack(side=TOP)
ws.mainloop()

 

 

  

posted @ 2021-11-17 16:42  linbo.yang  阅读(65)  评论(0编辑  收藏  举报