파일에 있는 사진을 버튼으로 만들
from tkinter import *
root = Tk()
root.title("Python GUI") #title 이름
root.geometry("1000x800+900+100")
photo = PhotoImage(file = "이모지.PNG")
btn = Button (root, image=photo)
btn.pack();
root.mainloop() #이벤트 체크
이모지 클릭할 때 text출력 함수 만들기 comand = btncmd
from tkinter import *
root = Tk()
root.title("Python GUI") #title 이름
root.geometry("1000x800+900+100")
def btncmd():
print('이모지를 꾸~욱 눌러주세여')
photo = PhotoImage(file = "이모지.PNG")
btn = Button (root, image=photo, command=btncmd)
btn.pack();
root.mainloop() #이벤트 체크
이미지 위에 text 추가
from tkinter import *
root = Tk()
root.title("Python GUI") #title 이름
root.geometry("1000x800+900+100")
label = Label(root, text = "누구인가?")
label.pack()
def btncmd():
print('이모지를 꾸~욱 눌렀습니다.')
photo = PhotoImage(file = "이모지.PNG")
btn = Button (root, image=photo, command=btncmd)
btn.pack();
root.mainloop() #이벤트 체크
이미지를 텍스트로 만들기 photo1 = PhotoImage(file = "이모지.PNG" )
from tkinter import *
root = Tk()
root.title("Python GUI") #title 이름
root.geometry("1000x800+900+100")
photo1 = PhotoImage(file = "이모지.PNG" )
label = Label(root, text = "누구인가?")
label = Label(root, image = photo1)
label.pack()
def btncmd():
print('이모지를 꾸~욱 눌렀습니다.')
photo = PhotoImage(file = "이모지.PNG")
btn = Button (root, image=photo, command=btncmd)
btn.pack();
root.mainloop() #이벤트 체크
https://piaocanyi.tistory.com/242
python GUI Label
from tkinter import * root = Tk() root.title("Python GUI") #title 이름 root.geometry("1000x800+900+100") label = Label(root, text = "최선을 다하자") label.pack() photo = PhotoImage(file = "이모지.PN..
piaocanyi.tistory.com