程式語言 - Python - Tkinter - Draw Circle



參考資訊:
https://tkdocs.com/shipman/
https://www.pythontutorial.net/tkinter/tkinter-window/

main.py

import tkinter as tk
 
root = tk.Tk()
root.title('main')
root.geometry('300x300')

canvas = tk.Canvas(root, width = 300, height = 300, bg = 'black')
canvas.grid()
canvas.create_oval(0, 0, 100, 100, fill = '#ff0000', outline = '#ffffff', width = 3)

root.mainloop()

執行

$ python3 main.py