from tkinter import *
root = Tk()
button = Button(root, text="Click me!")
img = PhotoImage(file="C:/path to image/example.gif") # make sure to add "/" not ""
button.config(image=img)
button.pack() # Displaying the button
root.mainloop()
import tkinter as tk
window = tk.Tk()
button=tk.Button(window, text="CLICK ME: ", command=testCommand)
"""creates the button and sets the location, text and what command to run once clicked"""
button.pack()
""" this loads the button in to the program.
you can use button.grid(row=1, column=1) as a another option to load this but both
cannot be used in a program together"""
window.mainloop()