본문 바로가기

tkinter4

[파이썬] tkinter Scale(슬라이더) 사용 from tkinter import * import pandas as pd readData = pd.DataFrame(columns=range(2)) readData.columns = ['t','value'] readData.loc[len(readData)] = ['21.10.2022 21:04:32',1.0] readData.loc[len(readData)] = ['21.10.2022 21:04:33',2.0] readData.loc[len(readData)] = ['21.10.2022 21:04:34',3.0] readData.loc[len(readData)] = ['21.10.2022 21:04:35',4.0] readData.loc[len(readData)] = ['21.10.2022 21:04:.. 2022. 10. 27.
[파이썬] tkinter simpledialog에서 입력한 문자로 수정하기 tkinter의 simpledialog는 간단한 윈도우 popup을 만들 수 있습니다. 이를 통해 입력을 받아서 Button의 Label 을 수정하는 코드입니다. import tkinter from tkinter.simpledialog import * mainFrame = Tk() name = 'O.K' def change(): name = tkinter.simpledialog.askstring("제목", "내용") nameLabel = b1 nameLabel["text"] = name name = 'O.K' b1 = Button(mainFrame, text=f"{name} 변경", command=change) b1.pack() mainFrame.mainloop() 2022. 10. 14.
[파이썬] UI (Tkinter) Popup Window / Image View Button의 처음 보이지 않도록 하기(pack_forget) 보이지 않는 Button 보이기(pack) Popup 윈도우 띄우기 (Toplevel) Popup 윈도우 canvas에 image 보이기(pack(expand=YES, fill=BOTH) , mainloop : 이 코드 없으면 image 가 안보임) from tkinter import * from tkinter import ttk win = Tk() win.geometry("750x400") def open_popup(): top= Toplevel(win) top.geometry("400x400") top.title("Child Window") canvas = Canvas(top, width=230, heigh=230, bg='white', .. 2022. 9. 22.
[파이썬] UI (Tkinter) Button, Label, MessageBox Tkinter package를 사용해서 UI를 만드는 간단한 코드 입니다. from tkinter import * import tkinter.messagebox win = Tk() win.geometry("750x270") def view(): tkinter.messagebox.showinfo('타이틀','MessageBox') win.title("Child Window") Label(win, text="Popup MessgeBox", font=('Helvetica 14 bold')).pack(pady=20) Button(win, text= "Show", command=view).pack() win.mainloop() 2022. 9. 22.
728x90
반응형