본문 바로가기

찐s/Raspberry Pi

[RPi] Lab.05-5: GUI (tkinter)

라즈베리파이에서 GUI 프로그래밍을 실습한다.

 

[tk_draw.py]

# tk_draw.py
import tkinter as tk

win = tk.Tk()
win.title('RaspberryPI GUI ')

c = tk.Canvas(win, width=300, height=300)
c.pack()
c.create_line(150, 0, 150, 300)
c.create_rectangle(50, 50, 250, 250)
c.create_oval(99, 99, 101, 101)
c.create_text(200, 200, text='*')

win.mainloop()

 

$ python3 tk_draw.py
 

 

 

 

[참조]

www.raspberrypi.org

 

'찐s > Raspberry Pi' 카테고리의 다른 글

[RPi] Lab.06-1: Install OpenCV  (0) 2021.10.23
[RPi] Lab.05-6: GUI (tkinter)  (0) 2021.10.09
[RPi] Lab.05-4: GUI (tkinter)  (0) 2021.09.25
[RPi] Lab.05-3: GUI (tkinter)  (0) 2021.08.29