MACにて Python3 と Tkinter をインストールする の続きです。
今回は Tkinter を使って簡素なウインドウアプリを作成します。
下記を参考にした。
import tkinter as tk WIN_TITLE='Tk' WIN_SIZE='100x50' LABEL_TEXT = 'Hello' # Window win = tk.Tk() win.title(WIN_TITLE) win.geometry(WIN_SIZE) label = tk.Label(win, text=LABEL_TEXT) label.pack() win.mainloop()
https://github.com//ohwada/MAC_cpp_Samples/tree/master/MAC_Python_Samples/tkinter/
実行すると、Tkウインドウが表示される。