0
1

More than 1 year has passed since last update.

【Python】Tkinterを使って✜マークを記述

Last updated at Posted at 2021-12-23

PythonとTkinterを使って✜マークを記述するコード。

実装コード

from tkinter import *

window = Tk()
window.geometry ("600x600")
window.attributes("-topmost",True)
window.title("sample window")

c = Canvas(window,width=600,height=600,background="green")

size = 3
for n in range(size):
 for m in range(size):
  if (n+m) % 2 == 1:
    c.create_rectangle(50+m*32,50+n*32,80+m*32,80+n*32,outline="",fill="black")
c.pack()
mainloop()

実行結果

スクリーンショット 2021-12-24 1.36.53.png
*わかりやすいように背景を緑色にしています。

Pythonのお役立ち情報

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1