close
> conda install –c anaconda tk
1: import tkinter as tk
2: win = tk.Tk()
3: win.mainloop()
1: import tkinter as tk
2: win = tk.Tk()
3: win.title('Hello World')
4: win.mainloop()
1: import tkinter as tk
2: win=tk.Tk()
3: win.title("Hello world")
4: #win.resizable(1,0) # horizontal resizable
5: #win.resizable(0,1) # verticle resizable
6: win.geometry('640x480')
7: win.resizable(0,0)
8: win.mainloop()
1: import tkinter as tk
2: win = tk.Tk()
3: win.title('Tk Win')
4: label = tk.Label(win, text='Hello World') #建立標籤物件
5: label.pack()
6: button=tk.Button(win, text='OK')
7: button.pack() #顯示元件
8: win.mainloop()
參考資料
1. https://anaconda.org/anaconda/tk
全站熱搜
留言列表