# data[].attributes.body
고2 물리 교과의 포물선 운동(Projectile Motion)

입력값으로 최고점과 도달거리를 계산해주는 간단한 GUI 프로그램

# data[].attributes.attachment_link.readable_text
import tkinter as tk 
import math

class ProjectileCalculator:
    def __init__(self, root):
        self.root = root
        self.root.title("��������� ������ ��������� (OOP)")

        tk.Label(root, text="������(���):").pack()
        self.entry_angle = tk.Entry(root)
        self.entry_angle.pack()

        tk.Label(root, text="������ ������(m/s):").pack()
        self.entry_velocity = tk.Entry(root)
        self.entry_velocity.pack()

        tk.Label(root, text="���������������(m/s^2):").pack()
        self.entry_g = tk.Entry(root)
        self.entry_g.insert(0, "9.8")
        self.entry_g.pack()

        btn = tk.Button(root, text="������", command=self.simulate)
        btn.pack()

        self.label_result = tk.Label(root, text="")
        self.label_result.pack()

    def simulate(self):
        try:
            angle = float(self.entry_angle.get())
            velocity = float(self.entry_velocity.get())
            g = float(self.entry_g.get())
            theta = math.radians(angle)
            max_height = (velocity**2) * (math.sin(theta)**2) / (2*g)
            max_distance = (velocity**2) * math.sin(2*theta) / g
            self.label_result.config(
                text=f"���������: {max_height:.2f} m\n������������: {max_distance:.2f} m")
        except:
            self.label_result.config(text="��������� ������������ ���������������.")

if __name__ == "__main__":
    root = tk.Tk()
    app = ProjectileCalculator(root)
    root.mainloop()

# data[].attributes.attachment_link.readable_text
import tkinter as tk
import math

class ProjectileCalculator:
    def __init__(self, root):
        self.root = root
        self.root.title("��������� ������ ��������� (OOP)")

        tk.Label(root, text="������(���):").pack()
        self.entry_angle = tk.Entry(root)
        self.entry_angle.pack()

        tk.Label(root, text="������ ������(m/s):").pack()
        self.entry_velocity = tk.Entry(root)
        self.entry_velocity.pack()

        tk.Label(root, text="���������������(m/s^2):").pack()
        self.entry_g = tk.Entry(root)
        self.entry_g.insert(0, "9.8")
        self.entry_g.pack()

        btn = tk.Button(root, text="������", command=self.simulate)
        btn.pack()

        self.label_result = tk.Label(root, text="")
        self.label_result.pack()

    def simulate(self):
        try:
            angle = float(self.entry_angle.get())
            velocity = float(self.entry_velocity.get())
            g = float(self.entry_g.get())
            theta = math.radians(angle)
            max_height = (velocity**2) * (math.sin(theta)**2) / (2*g)
            max_distance = (velocity**2) * math.sin(2*theta) / g
            self.label_result.config(
                text=f"���������: {max_height:.2f} m\n������������: {max_distance:.2f} m")
        except:
            self.label_result.config(text="��������� ������������ ���������������.")

if __name__ == "__main__":
    root = tk.Tk()
    app = ProjectileCalculator(root)
    root.mainloop()

# data[].attributes.body
1. 작성한 코드 파일(.py) 및 필요한 자료

2. 주요 기능 및 구현 방식 설명

3. 시연 영상

# data[].attributes.body
영화 예매 프로그램

# data[].attributes.attachment_link.readable_text
import random
from tkinter import *

PITCH_TYPES = ["������������", "������������������", "���������������"]
HIT_OUTCOMES = ["������", "2������", "3������", "������", "������", "������"]
BALL_STRIKE = ["���������������", "���"]

MAX_INNINGS = 9

class BaseballGameGUI:
    def __init__(self, root):
        self.root = root
        root.title("������ ������")
        root.geometry(f"{750}x{700}")

        self.outs = 0
        self.score = 0
        self.strikes = 0
        self.balls = 0
        self.pitched_ball = None
        self.bases = [None, None, None]
        self.inning = 1
        self.inning_scores = [0] * MAX_INNINGS

        self.score_board_frame = LabelFrame(self.root, text="���������", padx=5, pady=5)
        self.score_board_frame.pack(pady=10, fill=X)

        self.setup_score_board()

        self.info_label = Label(self.root, text="��������� ������������������.")
        self.info_label.pack(pady=10)

        self.status_label = Label(self.root, text=self.get_status())
        self.status_label.pack()

        self.diamond_frame = Frame(self.root)
        self.diamond_frame.pack(pady=20)

        self.home_label = Label(self.diamond_frame, text="���", width=6, borderwidth=1, relief="solid", anchor="center")
        self.home_label.grid(row=2, column=1, padx=5, pady=5)

        self.base1_label = Label(self.diamond_frame, text="1���", width=6, borderwidth=1, relief="solid", anchor="center")
        self.base1_label.grid(row=1, column=2, padx=5, pady=5)

        self.base2_label = Label(self.diamond_frame, text="2���", width=6, borderwidth=1, relief="solid", anchor="center")
        self.base2_label.grid(row=0, column=1, padx=5, pady=5)

        self.base3_label = Label(self.diamond_frame, text="3���", width=6, borderwidth=1, relief="solid", anchor="center")
        self.base3_label.grid(row=1, column=0, padx=5, pady=5)

        self.update_base_labels()

        # Swing type selection
        swing_frame = LabelFrame(self.root, text="������ ������", padx=5, pady=5)
        swing_frame.pack(pady=10, padx=10, fill=X)

        self.swing_type = StringVar(value="������")
        swing_choices = ["������", "������", "������"]
        for choice in swing_choices:
            Radiobutton(swing_frame, text=choice, variable=self.swing_type, value=choice).pack(side=LEFT, expand=True)

        # Guess pitch type selection
        guess_frame = LabelFrame(self.root, text="������ ������", padx=5, pady=5)
        guess_frame.pack(pady=10, padx=10, fill=X)

        self.guess = StringVar(value="������")
        guess_choices = ["������������", "������������������", "���������������", "������"]
        for choice in guess_choices:
            Radiobutton(guess_frame, text=choice, variable=self.guess, value=choice).pack(side=LEFT, expand=True)

        # Action buttons
        button_frame = Frame(self.root)
        button_frame.pack(pady=10)

        self.play_button = Button(button_frame, text="������!", command=self.play_ball_gui)
        self.play_button.pack(side=LEFT, padx=5)

        self.steal_button = Button(button_frame, text="������ ������", command=self.attempt_steal)
        self.steal_button.pack(side=LEFT, padx=5)

        self.next_inning_button = Button(button_frame, text="������ ������", command=self.new_inning)
        self.next_inning_button.pack(side=LEFT, padx=5)

        # Result label
        self.result_label = Label(self.root, text="",  wraplength=500)
        self.result_label.pack(pady=10)

        self.update_game_state_buttons()
        self.update_score_board()

    def setup_score_board(self):
     
        Label(self.score_board_frame, text="������",
              relief="solid", borderwidth=1, width=5).grid(row=0, column=0, padx=1, pady=1, sticky="nsew")

        self.inning_labels = []
        for i in range(MAX_INNINGS):
            label = Label(self.score_board_frame, text=f"{i+1}", relief="solid", borderwidth=1, width=4)
            label.grid(row=0, column=i+1, padx=1, pady=1, sticky="nsew")
            self.inning_labels.append(label)

        Label(self.score_board_frame, text="������", 
              relief="solid", borderwidth=1, width=6).grid(row=0, column=MAX_INNINGS + 1, padx=1, pady=1, sticky="nsew")

        Label(self.score_board_frame, text="������",
              relief="solid", borderwidth=1, width=5).grid(row=1, column=0, padx=1, pady=1, sticky="nsew")

        self.inning_score_labels = []
        for i in range(MAX_INNINGS):
            label = Label(self.score_board_frame, text="0",
                          relief="solid", borderwidth=1, width=4)
            label.grid(row=1, column=i+1, padx=1, pady=1, sticky="nsew")
            self.inning_score_labels.append(label)

        self.total_score_label = Label(self.score_board_frame, text="0", relief="solid", borderwidth=1, width=6)
        self.total_score_label.grid(row=1, column=MAX_INNINGS + 1, padx=1, pady=1, sticky="nsew")

    
    def update_score_board(self):
        for i in range(MAX_INNINGS):
            if i < self.inning:
                self.inning_score_labels[i].config(text=str(self.inning_scores[i]))
            else:
                self.inning_score_labels[i].config(text="")

        self.total_score_label.config(text=str(self.score))

    def get_status(self):
        
        return f"������: {self.inning}������ {self.outs} ������, {self.balls}��� {self.strikes}���������������"

    def update_base_labels(self):
      
        for label in [self.base1_label, self.base2_label, self.base3_label]:
            label.config(background="lightgray", foreground="black")

        if self.bases[0]:
            self.base1_label.config(background="yellow", foreground="black")
        if self.bases[1]:
            self.base2_label.config(background="yellow", foreground="black")
        if self.bases[2]:
            self.base3_label.config(background="yellow", foreground="black")

        self.root.update_idletasks()

    def update_game_state_buttons(self):
        """������ ������ ��������� ������ ��������� ���������/������������ ��������� ������������"""
        game_over = self.inning > MAX_INNINGS or (self.inning == MAX_INNINGS and self.outs == 3)

        if game_over:
            self.play_button.config(state=DISABLED)
            self.steal_button.config(state=DISABLED)
            self.next_inning_button.config(state=DISABLED)
        else:
            self.play_button.config(state=NORMAL if self.outs < 3 else DISABLED)

            can_steal = (self.bases[0] or self.bases[1]) and self.outs < 3
            self.steal_button.config(state=NORMAL if can_steal else DISABLED)

            self.next_inning_button.config(state=NORMAL if self.outs == 3 and self.inning < MAX_INNINGS else DISABLED)


    def play_ball_logic(self, swing_type="normal", guess=None):
       
        if any(self.bases) and random.random() < 0.003:
            return "������", None, ""

        pitched_ball = random.choice(PITCH_TYPES)
        self.pitched_ball = pitched_ball

        outcomes = ["���������������", "���", "������", "2������", "3������", "������", "������", "������"]
        weights = [0.25, 0.2, 0.15, 0.05, 0.01, 0.03, 0.2, 0.12]

        if swing_type == "������":
            weights[2] += 0.05
            weights[3] -= 0.02
            weights[4] -= 0.01
            weights[5] -= 0.01
            weights[6] -= 0.01
            weights[7] += 0.02
        elif swing_type == "������":
            weights[2] -= 0.05
            weights[3] += 0.02
            weights[4] += 0.02
            weights[5] += 0.03
            weights[6] += 0.02
            outcomes.append("���������")
            weights.append(0.05)

        total_weight = sum(weights)
        weights = [w / total_weight for w in weights]

        result = random.choices(outcomes, weights=weights, k=1)[0]

        prediction_feedback = ""
        modified_result = result

        if guess and guess in PITCH_TYPES:
            predicted_pitch = guess
            actual_pitch = pitched_ball
            if predicted_pitch == actual_pitch:
                prediction_feedback = "������ ������ ������! "
                if result in ["������", "2������", "3������", "������"]:
                    modified_result = random.choices(["������", "2������", "3������", "������", result],
                                                     weights=[0.05, 0.03, 0.02, 0.01, 0.89], k=1)[0]
                elif result == "������":
                    modified_result = random.choice(["������", "������", "���������������"])
                elif result == "������":
                    modified_result = random.choice(["������", "������", "������"])
                elif result == "���������������":
                    modified_result = random.choice(["���", "���������������"])
            else:
                prediction_feedback = "������ ������ ������... "
                if result in ["������", "2������", "3������", "������"]:
                    modified_result = random.choices(["������", "������", "���������������", result], weights=[0.2, 0.2, 0.1, 0.5], k=1)[0]
                elif result == "���������������":
                    modified_result = random.choice(["���������", "���������������"])
                elif result == "���":
                    modified_result = random.choice(["���������������", "���"])

        return modified_result, pitched_ball, prediction_feedback

    def handle_hit(self, hit_type):
        """������, 2������, 3������, ������ ������ ������"""
        runs_scored_this_play = 0

        if hit_type == "������":
            for i in range(3):
                if self.bases[i]:
                    runs_scored_this_play += 1
                    self.bases[i] = None
            runs_scored_this_play += 1
            self.bases = [None, None, None]
        else:
            if self.bases[2]:
                runs_scored_this_play += 1
            self.bases[2] = self.bases[1]
            self.bases[1] = self.bases[0]
            self.bases[0] = True if hit_type == "������" else None

            if hit_type == "2������":
                if self.bases[1]:
                    runs_scored_this_play += 1
                self.bases[2] = self.bases[0]
                self.bases[1] = True
                self.bases[0] = None
            elif hit_type == "3������":
                if self.bases[1]:
                    runs_scored_this_play += 1
                if self.bases[0]:
                    runs_scored_this_play += 1
                self.bases[2] = True
                self.bases[1] = None
                self.bases[0] = None

        self.score += runs_scored_this_play
        self.inning_scores[self.inning - 1] += runs_scored_this_play
        self.result_label.config(text=f"{runs_scored_this_play}��� ������!")
        self.update_score_board()

    def handle_balk(self):
       
        self.info_label.config(text="������! ������ ��������� ��� ������ ���������������.")
        self.result_label.config(text="������! ��������� ���������������.")

        if self.bases[2]:
            self.score += 1
            self.inning_scores[self.inning - 1] += 1

        self.bases[2] = self.bases[1]
        self.bases[1] = self.bases[0]
        self.bases[0] = True

        self.strikes = 0
        self.balls = 0
        self.status_label.config(text=self.get_status())
        self.update_base_labels()
        self.update_game_state_buttons()
        self.update_score_board()

    def attempt_steal(self):
        """������ ������ ������"""
        self.play_button.config(state=DISABLED)
        self.steal_button.config(state=DISABLED)
        self.next_inning_button.config(state=DISABLED)

        runner_on_1st = self.bases[0]
        runner_on_2nd = self.bases[1]

        if not (runner_on_1st or runner_on_2nd):
            self.result_label.config(text="��������� ��������� ������������!")
            self.info_label.config(text="������ ������ ������: ������ ������.")
            self.update_game_state_buttons()
            return

        steal_successful = False
        stolen_base_text = ""
        action_performed = False

        if runner_on_2nd:
            action_performed = True
            if random.random() < 0.6:
                self.bases[2] = True
                self.bases[1] = None
                steal_successful = True
                stolen_base_text = "2��� ������ 3��� ������ ������!"
            else:
                self.bases[1] = None
                self.outs += 1
                steal_successful = False
                stolen_base_text = "2��� ������ 3��� ������ ������! ������!"

        elif runner_on_1st and not runner_on_2nd:
            action_performed = True
            if random.random() < 0.7:
                self.bases[1] = True
                self.bases[0] = None
                steal_successful = True
                stolen_base_text = "1��� ������ 2��� ������ ������!"
            else:
                self.bases[0] = None
                self.outs += 1
                steal_successful = False
                stolen_base_text = "1��� ������ 2��� ������ ������! ������!"

        if action_performed:
            self.result_label.config(text=stolen_base_text)
            self.info_label.config(text="������ ������ ��������� ���������������.")
        else:
            self.result_label.config(text="��������� ��������� ������������!")

        self.strikes = 0
        self.balls = 0

        self.status_label.config(text=self.get_status())
        self.update_base_labels()
        self.update_game_state_buttons()
        self.update_score_board()

        if self.outs == 3:
            self.info_label.config(text=f"\n--- {self.inning}������ ������ ---\n������ ������: {self.score}���")
            self.bases = [None, None, None]

    def play_ball_gui(self):
        """������ ��������� ������ ������ ��� ������������ ������"""
        if self.outs == 3 or self.inning > MAX_INNINGS:
            self.info_label.config(text=f"\n--- ������ ������ ---\n������ ������: {self.score}���")
            self.update_game_state_buttons()
            return

        swing_choice = self.swing_type.get()
        guess_choice = self.guess.get()
        guess_for_logic = guess_choice if guess_choice != "������" else None

        pitch_result, actual_pitch, prediction_feedback = self.play_ball_logic(swing_choice, guess_for_logic)

        full_result_text = ""

        if pitch_result == "������":
            self.handle_balk()
            full_result_text = "������!"
        else:
            base_result_text = f"��������� ���������������! ({actual_pitch}) ���������... **{pitch_result}**!"
            if prediction_feedback:
                full_result_text = prediction_feedback + base_result_text
            else:
                full_result_text = base_result_text

            if pitch_result == "���������������":
                self.strikes += 1
                self.info_label.config(text="���������������!")
            elif pitch_result == "���":
                self.balls += 1
                self.info_label.config(text="���!")
            elif pitch_result in ["������", "2������", "3������", "������"]:
                self.info_label.config(text=f"{pitch_result}���������!")
                self.handle_hit(pitch_result)
                self.strikes = 0
                self.balls = 0
            elif pitch_result == "������":
                self.outs += 1
                self.strikes = 0
                self.balls = 0
                self.info_label.config(text="������!")
            elif pitch_result == "������":
                self.info_label.config(text="������!")
                if self.strikes < 2:
                    self.strikes += 1
            elif pitch_result == "���������":
                self.strikes += 1
                self.info_label.config(text="���������!")

            if self.strikes == 3:
                self.info_label.config(text="������ ������!")
                self.outs += 1
                self.strikes = 0
                self.balls = 0
                full_result_text += "\n������ ���������������!"

            elif self.balls == 4:
                self.info_label.config(text="������!")
                full_result_text += "\n������������ 1������ ���������������!"
                if self.bases[2]: self.score += 1
                self.bases[2] = self.bases[1]
                self.bases[1] = self.bases[0]
                self.bases[0] = True
                self.strikes = 0
                self.balls = 0
                self.inning_scores[self.inning - 1] += 1
                self.update_score_board()

        self.result_label.config(text=full_result_text)
        self.status_label.config(text=self.get_status())
        self.update_base_labels()
        self.update_game_state_buttons()

        if self.outs == 3:
            if self.inning < MAX_INNINGS:
                self.info_label.config(text=f"\n--- {self.inning}������ ������ ---\n������ ������: {self.score}���")
                self.bases = [None, None, None]
            else:
                self.info_label.config(text=f"\n--- 9������ ������! ������ ������ ---\n������ ������: {self.score}���")


    def new_inning(self):
        """������ ������"""
        if self.inning >= MAX_INNINGS:
            self.info_label.config(text=f"\n--- ������ ������ ---\n������ ������: {self.score}���")
            self.update_game_state_buttons()
            return

        self.outs = 0
        self.strikes = 0
        self.balls = 0
        self.bases = [None, None, None]
        self.inning += 1
        if len(self.inning_scores) < self.inning:
            self.inning_scores.append(0)

        self.info_label.config(text=f"{self.inning}��������� ���������������������. ��������� ������������������.")
        self.status_label.config(text=self.get_status())
        self.result_label.config(text="")
        self.update_base_labels()
        self.update_game_state_buttons()
        self.update_score_board()


root = Tk()
game_gui = BaseballGameGUI(root)
root.mainloop()

# data[].attributes.headline
<결과물 주제> 뒤집기 게임

# data[].attributes.subject
<결과물 주제> 뒤집기 게임

# data[].attributes.body
주요 기능 : 카드가 20장이 랜덤으로 섞이고 5초동안 카드를 보여주고 뒤집은다음 같은짝을 맞추면 없어지고 10번 틀리면 탈락하고 위에 시간이 뜬다.

구현 방식 : 이 게임은 tkinter를 이용해 만든 짝맞추기 게임이다. random.shuffle()을 써서 1부터 10까지 숫자를 두 장씩 섞어 카드 리스트를 만들고, tk.Button으로 20장의 버튼을 만든다. 게임 시작 시 after()를 이용해 5초 동안 모든 카드를 보여주고, 이후 ?로 뒤집으며 본격적으로 게임이 시작된다. 유저가 카드를 클릭하면 on_click() 함수가 실행되어 두 장의 숫자를 비교한다. 같으면 성공 처리하고, 다르면 다시 뒤집고 wrong_attempts가 1 증가한다. 10번 틀리면 messagebox.showinfo()로 게임 종료 메시지를 띄운다. 시간은 time.time()으로 측정하며, after(100, ...)으로 0.1초 단위로 경과 시간을 갱신해 화면에 계속 보여준다.

# data[].attributes.attachment_link.readable_text
import tkinter as tk
import random
from tkinter import messagebox
import time

class MemoryGame:
    def __init__(self, root):
        self.root = root
        self.root.title("��� ��������� ������")
        self.cards = list(range(1, 11)) * 2
        random.shuffle(self.cards)
        self.buttons = []
        self.flipped = []
        self.matched = set()  
        self.is_game_active = False  
        self.wrong_attempts = 0  
        self.start_time = None
        self.timer_running = False
        self.create_widgets()
        self.show_all_cards()

    def create_widgets(self):
       
        self.timer_label = tk.Label(self.root, text="������: 0.00���", font=("Arial", 12))
        self.timer_label.grid(row=0, column=0, columnspan=5, pady=5)

        for i in range(20):
            btn = tk.Button(self.root, text="", width=6, height=3,
                            command=lambda idx=i: self.on_click(idx),
                            font=("Arial", 14))
            btn.grid(row=(i // 5) + 1, column=i % 5, padx=5, pady=5)
            self.buttons.append(btn)

        
        self.status_label = tk.Label(self.root, text="������ ������: 0 / 10", font=("Arial", 12))
        self.status_label.grid(row=6, column=0, columnspan=5, pady=10)

    def show_all_cards(self):
        
        for i in range(20):
            self.buttons[i]["text"] = str(self.cards[i])
            self.buttons[i]["state"] = "disabled"
        self.root.after(5000, self.start_game) 

    def start_game(self):
      
        for i in range(20):
            self.buttons[i]["text"] = "?"
            self.buttons[i]["state"] = "normal"
        self.is_game_active = True
        self.wrong_attempts = 0
        self.update_status()
        self.start_time = time.time()
        self.timer_running = True
        self.update_timer()

    def update_status(self):
        self.status_label.config(text=f"������ ������: {self.wrong_attempts} / 10")

    def update_timer(self):
        if self.timer_running:
            elapsed = time.time() - self.start_time
            self.timer_label.config(text=f"������: {elapsed:.2f}���")
            self.root.after(100, self.update_timer) 

    def on_click(self, idx):
        if not self.is_game_active:
            return 
        if idx in self.matched:
            return 
        if idx in self.flipped:
            return 
        if len(self.flipped) == 2:
            return  

        
        self.buttons[idx]["text"] = str(self.cards[idx])
        self.flipped.append(idx)

        if len(self.flipped) == 2:
            self.is_game_active = False 
            self.root.after(1000, self.check_match) 

    def check_match(self):
        i1, i2 = self.flipped
        if self.cards[i1] == self.cards[i2]:
           
            self.buttons[i1].config(text="", state="disabled", bg="lightgray")
            self.buttons[i2].config(text="", state="disabled", bg="lightgray")
            self.matched.update(self.flipped)
        else:
          
            self.wrong_attempts += 1
            self.update_status()

           
            self.buttons[i1]["text"] = "?"
            self.buttons[i2]["text"] = "?"

           
            if self.wrong_attempts >= 10:
                self.is_game_active = False
                self.timer_running = False
                elapsed = time.time() - self.start_time
                messagebox.showinfo("������ ������", f"10��� ��������� ������ ���!\n������ ������: {elapsed:.2f}���")
                self.root.destroy()
                return

        self.flipped = []
        self.is_game_active = True

        if len(self.matched) == len(self.cards):
            self.timer_running = False
            elapsed = time.time() - self.start_time
            messagebox.showinfo("������ ������", f"������ ��������� ������������! ���������������!\n������ ������: {elapsed:.2f}���")
            self.root.destroy()

if __name__ == "__main__":
    root = tk.Tk()
    game = MemoryGame(root)
    root.mainloop()

# data[].attributes.headline
<결과물 주제> 압력계산 프로그램

# data[].attributes.subject
<결과물 주제> 압력계산 프로그램

# data[].attributes.body
import tkinter as tk
import math

class ProjectileCalculator:
    def __init__(self, root):
        self.root = root
        self.root.title("포물선 운동 계산기 (OOP)")

        tk.Label(root, text="각도(도):").pack()
        self.entry_angle = tk.Entry(root)
        self.entry_angle.pack()

        tk.Label(root, text="초기 속도(m/s):").pack()
        self.entry_velocity = tk.Entry(root)
        self.entry_velocity.pack()

        tk.Label(root, text="중력가속도(m/s^2):").pack()
        self.entry_g = tk.Entry(root)
        self.entry_g.insert(0, "9.8")
        self.entry_g.pack()

        btn = tk.Button(root, text="계산", command=self.simulate)
        btn.pack()

        self.label_result = tk.Label(root, text="")
        self.label_result.pack()

    def simulate(self):
        try:
            angle = float(self.entry_angle.get())
            velocity = float(self.entry_velocity.get())
            g = float(self.entry_g.get())
            theta = math.radians(angle)
            max_height = (velocity**2) * (math.sin(theta)**2) / (2*g)
            max_distance = (velocity**2) * math.sin(2*theta) / g
            self.label_result.config(
                text=f"최고점: {max_height:.2f} m\n도달거리: {max_distance:.2f} m")
        except:
            self.label_result.config(text="숫자를 올바르게 입력하세요.")

if __name__ == "__main__":
    root = tk.Tk()
    app = ProjectileCalculator(root)
    root.mainloop()

# data[].attributes.body
이 코드는 Python의 tkinter 라이브러리를 활용하여 만든 간단한 영화 예매 및 리뷰 프로그램입니다. 사용자는 화면에 표시된 세 개의 영화 포스터 중 하나를 클릭하여 해당 영화의 예매 창을 띄울 수 있습니다. 예매 창에서는 날짜와 좌석을 선택할 수 있으며, "예매하기" 버튼을 누르면 예매가 완료되었다는 메시지가 뜨고 자동으로 리뷰 작성 창이 열립니다.

리뷰 작성 창에서는 1부터 5까지의 버튼 중 하나를 눌러 평점을 선택하고, 텍스트 상자에 댓글을 입력하여 "제출" 버튼을 누르면 해당 영화에 대한 리뷰가 저장됩니다. 각 영화의 리뷰는 별도로 저장되며, 메인 화면 아래에 있는 "내 리뷰 보기" 버튼을 클릭하면 지금까지 입력한 모든 영화의 평균 평점과 개별 리뷰를 확인할 수 있는 창이 뜹니다.

이미지는 PhotoImage를 이용해 불러오며, 각 영화는 리스트로 제목과 이미지가 저장되어 있고, 평점과 댓글은 딕셔너리 형태로 관리됩니다. 전체적으로 함수나 클래스를 최소화하고 절차적으로 작성된 코드로, GUI 입문자나 Python 초보자도 흐름을 따라가기 쉽게 구성되어 있습니다.

4o

# data[].attributes.body
이 프로그램은 파이썬의 tkinter를 이용해 만든 GUI 계산기로, 고등학교 물리에서 사용하는 공식인 압력(P = F/A)과 그 역공식(F = P×A)을 기반으로 압력과 힘을 계산해준다. 사용자는 힘(F)과 면적(A)을 입력해 압력을 Pa, kPa, bar 단위로 얻거나, 압력(P)과 면적(A)을 입력해 힘을 N 단위로 구할 수 있으며, 각 입력값의 단위도 선택 가능해 단위 변환이 자동으로 이루어진다. 초기화 버튼을 통해 입력값과 결과를 손쉽게 리셋할 수 있으며, 입력 오류 시 안내 메시지를 출력하는 기능도 포함돼 있다.

# data[].attributes.headline
<결과물 주제> 타자연습(애국가)

# data[].attributes.subject
<결과물 주제> 타자연습(애국가)

# data[].attributes.body
애국가 1절 구현 (4절가사는 주석처리)

주요기능 애국가의 가사가 나오고 이를 따라치고 Enter를 누르면 다음 가사로 넘어감. 근데 틀리면 넘어가지지 않음. 그리고 가사를 전부 입력한 후 끝을 입력하면 걸린 시간을 출력해 줌.

구현 방식

1. 엔트리 두 개를 만든다.

2. 시작 부분에 시작 시간을 받게 해준다.

3. 애국가의 가사가 들어갈 리스트를 만들고 가사를 입력해준다.

4. 이제 그 리스트의 가사를 순서대로 첫 번째 엔트리에 넣는다.

5. 이제 두 번째 엔트리에 가사를 입력받는다.

6. 첫 번째 엔트리의 가사와 두 번째 엔트리의 가사가 같다면 리스트에 있는 다음 가사가 첫 번째 엔트리에 나오게 하고 두 번째 엔트리에 입력받았던 가사를 삭제한다.

7. 이때 첫 번째 엔트리의 상태가 readonly라면 insert, delete같은 것들이 작동하지 않기 때문에 잠깐 normal 상태로 바꾼 뒤에 리스트에 있는 다음가사를 넣는다.

8. 그리고 이 과정을 반복하면 마지막 가사까지 도달하고 끝나게 된다.

9. 다 끝나고 난 뒤 끝을 입력하고 나면 끝난 시간을 측정한 뒤 끝난 시간 - 시작 시간을 해서 걸린 시간을 출력한다.

# data[].attributes.body
기능

# data[].attributes.body
ai 모델 선택 gui

# data[].attributes.body
과속방지 카메라 프로그래밍

# data[].attributes.body
o/x 퀴즈

# data[].attributes.body
건강기능식품 복용 관리 시뮬레이터

# data[].attributes.body
삼각함수 그래프 그리기 프로그램

# data[].attributes.headline
건강기능식품 섭취 도우미(최종본)

# data[].attributes.subject
건강기능식품 섭취 도우미(최종본)

# data[].attributes.body
건강기능식품 클래스는 보조제의 이름, 반감기, 정보를 저장하며, 반감기를 바탕으로 소멸 상수 k를 계산한다. k값은 약물 농도가 시간에 따라 지수함수적으로 감소하는 모델링에 사용된다. 농도_계산 메서드는 초기 농도와 경과 시간을 입력받아 현재 체내 농도를 계산하며, 최적_복용_간격 메서드는 농도가 기준 값(기본 50%)까지 감소하는 시간을 반환한다.

건강기능식품_앱 클래스는 Tkinter GUI를 구성하며, 사용자로부터 보조제 선택, 초기 농도, 경과 시간, 복용 간격을 입력받는다. 선택한 보조제 정보를 화면에 보여주고, 농도 계산 버튼을 누르면 입력값을 검증한 후 농도를 계산한다. 계산 결과는 텍스트와 농도 비율에 따라 색이 변하는 막대그래프로 시각화된다. 농도가 낮을 경우 경고 문구도 출력된다

# data[].attributes.attachment_link.readable_text
from tkinter import *
import math 

root = Tk()
root.title('������������������ ������ ���������')
root.geometry("300x400")

class Supplement:
    def __init__(self, name, half_life, info):
        self.name = name
        self.half_life = half_life
        self.info = info
        self.k = math.log(2) / half_life
        # C(t) = C��� �� e^(-k��t)
        
    def get_concentration(self, initial, time):
        return initial * math.exp(-self.k * time)

    def get_optimal_interval(self, threshold=0.5):
        return math.log(threshold) / -self.k

class SupplementApp:
    def __init__(self, root):
        self.root = root
        self.root.title("������������������ ������ ���������")
        self.supplements = {"��������� C": Supplement("��������� C", 6, "��������� ��������� ������"),
                            "��������� D": Supplement("��������� D", 15, "��� ������ ��������� ������"),
                            "���������-3": Supplement("���������-3", 72, "��������� ��������� ������")}
        Label(root, text="��������� ������:").pack()
        self.drug_var = StringVar(root)
        self.drug_menu = OptionMenu(root, self.drug_var, *self.supplements.keys(), command=self.show_info)
        self.drug_menu.pack()
        Label(root, text="������ ������ (mg):").pack()
        self.entry_initial = Entry(root)
        self.entry_initial.pack()
        Label(root, text="������ ������ (������):").pack()
        self.entry_time = Entry(root)
        self.entry_time.pack()
        Label(root, text="������ ������ (������������ ������ ������):").pack()
        self.entry_interval = Entry(root)
        self.entry_interval.pack()

        Button(root, text="������ ������", command=self.calculate).pack(pady=5)

        self.result_label = Label(root, text="", fg="blue")
        self.result_label.pack()
        self.info_label = Label(root, text="", fg="green")
        self.info_label.pack()
        self.canvas = Canvas(root, width=200, height=20, bg='white')
        self.canvas.pack()

    def show_info(self, selected):
        info = self.supplements[selected].info
        self.info_label.config(text=f"{selected} ������: {info}")

    def calculate(self):
        name = self.drug_var.get()
        if name not in self.supplements:
            self.result_label.config(text="��������� ���������������", fg="red")
            return
        try:
            initial = float(self.entry_initial.get())
            time = float(self.entry_time.get())
        except ValueError:
            self.result_label.config(text="��������� ������������ ���������������", fg="red")
            return

        drug = self.supplements[name]
        conc = drug.get_concentration(initial, time)
        optimal = drug.get_optimal_interval()
        conc_ratio = conc / initial
        bar_length = int(conc_ratio * 200)
        self.canvas.delete("all")
        color = "green" if conc_ratio > 0.6 else "orange" if conc_ratio > 0.3 else "red"
        self.canvas.create_rectangle(0, 0, bar_length, 20, fill=color)
        warning = "������ ��������� ������������!" if conc_ratio < 0.3 else ""
        self.result_label.config(text=f"������ ������: {conc:.2f} mg\n������ ������: {optimal:.1f}������\n{warning}", fg="blue")

app = SupplementApp(root)
root.mainloop()

# data[].attributes.attachment_link.title
건강기능식품 섭취 도우미 ver.Eng

# data[].attributes.attachment_link.readable_text
from tkinter import *
from tkinter import messagebox
import time
import random
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg

# Tkinter ���������
root = Tk()
root.title("������ ������ ��������� ��������������� + ��������� ������ ���������")
root.geometry("1000x700")

# ��������� ������������
car_img = PhotoImage(file="���������.png").subsample(1, 1)
road_img = PhotoImage(file="������.png").zoom(4, 2)
cam_img = PhotoImage(file="���������.png").subsample(3, 3)

# ���������
cvs = Canvas(root, bg="white", highlightthickness=0, height=400)
cvs.pack(fill=X)

# ��������� ������
img_road = cvs.create_image(500, 200, anchor=CENTER, image=road_img)
img_cam = cvs.create_image(0, 200, anchor=CENTER, image=cam_img)
img_car = cvs.create_image(100, 250, anchor=CENTER, image=car_img)

# UI
Label(root, text="���� ������ (km/h) ������:").pack()
speed_entry = Entry(root)
speed_entry.pack()

# ������ ������ ��� ������
LIMIT_SPEED_KMPH = 60
pixel_to_meter = 0.1

# ������ ������
moving = False
start_time = 0
end_x = 900
speed_log = []
time_log = []

# ��������� ��������� ���������
fig, ax = plt.subplots(figsize=(6, 3))
ax.set_title("������ ������")
ax.set_xlabel("������ (���)")
ax.set_ylabel("������ (km/h)")
line, = ax.plot([], [], 'r-')

canvas_frame = Frame(root)
canvas_frame.pack()
graph_canvas = FigureCanvasTkAgg(fig, master=canvas_frame)
graph_canvas.get_tk_widget().pack()

def update_graph():
    if moving:
        line.set_data(time_log, speed_log)
        ax.relim()
        ax.autoscale_view()
        graph_canvas.draw()
        root.after(500, update_graph)

def move_car(base_pixels_per_frame, base_speed_kmph):
    global moving, start_time

    if not moving:
        return

    # ��3 km/h ������ ������
    varied_speed = base_speed_kmph + random.uniform(-3, 3)
    varied_pixels_per_sec = (varied_speed / 3.6) / pixel_to_meter
    varied_pixels_per_frame = varied_pixels_per_sec * 0.03

    cvs.move(img_car, varied_pixels_per_frame, 0)
    x, y = cvs.coords(img_car)

    elapsed = time.time() - start_time
    time_log.append(round(elapsed, 2))
    speed_log.append(varied_speed)

    if x+70 >= end_x:
        moving = False
        elapsed_time = time.time() - start_time
        distance_px = end_x - 100
        real_distance_m = distance_px * pixel_to_meter
        avg_speed = (real_distance_m / elapsed_time) * 3.6

        msg = f"��� ������ ������: {avg_speed:.2f} km/h\n"
        msg += "���� ���������������!" if avg_speed > LIMIT_SPEED_KMPH else "��� ������ ���������������!"
        messagebox.showinfo("������ ������", msg)
        return
    else:
        root.after(30, lambda: move_car(base_pixels_per_frame, base_speed_kmph))

def start_moving():
    global moving, start_time, speed_log, time_log

    try:
        input_speed = float(speed_entry.get())
    except ValueError:
        messagebox.showerror("������ ������", "��������� ���������������.")
        return

    speed_log = []
    time_log = []
    cvs.coords(img_car, 100, 250)
    pixels_per_second = (input_speed / 3.6) / pixel_to_meter
    pixels_per_frame = pixels_per_second * 0.03

    start_time = time.time()
    moving = True
    move_car(pixels_per_frame, input_speed)
    update_graph()

def on_canvas_resize(event):
    global end_x
    canvas_width = cvs.winfo_width()
    end_x = canvas_width - 100
    cam_x = canvas_width // 2
    cvs.coords(img_cam, cam_x, 50)
    cvs.coords(img_road, canvas_width // 2, 200)

cvs.bind("<Configure>", on_canvas_resize)

# ������
Button(root, text="���� ������", command=start_moving).pack(pady=10)

root.mainloop()

# data[].attributes.body
1. 구현 방식:entry를 사용해 진폭, 주파수, 위상 값을 입력받는다.입력값을 바탕으로 math.sin() 함수로 사인파 값을 계산한다. 각 픽셀에 대응하는 x,y값을 좌표로 변환한 후, canvas의 create_line() 함수로 계산한 좌표들을 연결하여 사인파를 그린다.

2. 주요 기능: 사인파 개념 이해를 직접 프로그램을 이용함으로써 실습해볼 수 있어서 좋다.

# data[].attributes.attachment_link.readable_text
import tkinter as tk
import math

def draw_sine():
    A = float(amplitude_entry.get())
    f = float(frequency_entry.get())
    phi_deg = float(phase_entry.get())

    canvas.delete("all")

    width = canvas.winfo_width()
    height = canvas.winfo_height()
    center_y = height // 2

    points = []
    phi = math.radians(phi_deg)
    omega = 2 * math.pi * f

    for x_pixel in range(width):
        x_rad = (x_pixel / width) * 4 * math.pi
        y = A * math.sin(omega * x_rad + phi)
        y_pixel = center_y - y * (height / 4)
        points.append((x_pixel, y_pixel))

    for i in range(len(points) - 1):
        canvas.create_line(points[i][0], points[i][1], points[i+1][0], points[i+1][1], fill="blue")

    canvas.create_text(width - 80, center_y - 20, text=f"������(A)={A}", fill="black")
    canvas.create_text(width - 80, center_y - 40, text=f"���������(f)={f} Hz", fill="black")
    canvas.create_text(width - 80, center_y - 60, text=f"������(��)={phi_deg}��", fill="black")

root = tk.Tk()
root.title("��������� ���������")

frame = tk.Frame(root)
frame.pack(padx=10, pady=5)

def add_entry(label, row):
    tk.Label(frame, text=label).grid(row=row, column=0, sticky="w")
    entry = tk.Entry(frame, width=10)
    entry.grid(row=row, column=1)
    return entry

amplitude_entry = add_entry("������ (A):", 0)
frequency_entry = add_entry("��������� (f, Hz):", 1)
phase_entry = add_entry("������ (��, ���):", 2)

draw_button = tk.Button(root, text="��������� ���������", command=draw_sine)
draw_button.pack(pady=5)

canvas = tk.Canvas(root, width=600, height=300, bg="white")
canvas.pack()

root.mainloop()


# data[].attributes.body
Question 클래스에 문제, 정답, 힌트를 담고, QuizManager가 문제 진행과 정답 판정을 담당한다. QuizApp 클래스는 버튼, 레이블, 체크박스, 리스트박스 등으로 구성된 사용자 인터페이스를 만들어 문제를 보여주고 정답 여부를 판단해 결과를 기록한다. 모든 문제를 풀면 점수를 알려주며 게임이 종료된다.

# data[].attributes.attachment_link.readable_text
import tkinter as tk

from tkinter import messagebox

class ToDoApp:

    def __init__(self, root):

        root.title("��������� ������ ���������")

        root.geometry("400x450")

        self.tasks = []

        self.entry = tk.Entry(root)

        self.entry.pack(padx=10, pady=10, fill=tk.X)

        tk.Button(root, text="������", command=self.add_task).pack(pady=5)

        self.listbox = tk.Listbox(root)

        self.listbox.pack(padx=10, pady=10, fill=tk.BOTH, expand=True)

        btn_frame = tk.Frame(root)

        btn_frame.pack(pady=5)

        tk.Button(btn_frame, text="������ ������", command=self.toggle_complete).pack(side=tk.LEFT, padx=5)

        tk.Button(btn_frame, text="������", command=self.delete_task).pack(side=tk.LEFT, padx=5)

    def add_task(self):

        task = self.entry.get().strip()

        if not task:

            messagebox.showwarning("������", "��������� ���������������")

            return

        self.tasks.append({"task": task, "done": False})

        self.entry.delete(0, tk.END)

        self.update_listbox()

    def update_listbox(self):

        self.listbox.delete(0, tk.END)

        for t in self.tasks:

            mark = "���" if t["done"] else "���"

            self.listbox.insert(tk.END, f"{mark} {t['task']}")

    def delete_task(self):

        selected = self.listbox.curselection()

        if not selected:

            messagebox.showwarning("������", "��� ������ ���������������")

            return

        idx = selected[0]

        del self.tasks[idx]

        self.update_listbox()

    def toggle_complete(self):

        selected = self.listbox.curselection()

        if not selected:

            messagebox.showwarning("������", "��� ������ ���������������")

            return

        idx = selected[0]

        self.tasks[idx]["done"] = not self.tasks[idx]["done"]

        self.update_listbox()

if __name__ == "__main__":

    root = tk.Tk()

    ToDoApp(root)

    root.mainloop()

# data[].attributes.attachment_link.readable_text
import tkinter as tk
from tkinter import messagebox, ttk
from datetime import datetime

class TodoApp:
    def __init__(self, root):
        self.root = root
        self.root.title("��� ��� ������ ������ ��� (������������ + ���������)")
        self.root.geometry("600x500")
        
        # ��� ��� ������ ��������� ������ ���������
        self.tasks = []
        
        # ������������ ������
        self.priority_options = ["������", "������", "������"]
        
        # UI ������
        self.create_widgets()
    
    def create_widgets(self):
        # ������ ���������
        input_frame = tk.Frame(self.root)
        input_frame.pack(pady=10)
        
        # ��� ��� ������
        tk.Label(input_frame, text="��� ���:").grid(row=0, column=0, padx=5)
        self.task_entry = tk.Entry(input_frame, width=25)
        self.task_entry.grid(row=0, column=1, padx=5)
        
        # ��������� ������
        tk.Label(input_frame, text="���������:").grid(row=0, column=2, padx=5)
        self.due_date_entry = tk.Entry(input_frame, width=12)
        self.due_date_entry.grid(row=0, column=3, padx=5)
        tk.Label(input_frame, text="(YYYY-MM-DD)").grid(row=1, column=3)
        
        # ������������ ������
        tk.Label(input_frame, text="������������:").grid(row=0, column=4, padx=5)
        self.priority_var = tk.StringVar(value="������")
        self.priority_menu = ttk.Combobox(input_frame, textvariable=self.priority_var, 
                                        values=self.priority_options, width=8, state="readonly")
        self.priority_menu.grid(row=0, column=5, padx=5)
        
        add_button = tk.Button(input_frame, text="������", command=self.add_task)
        add_button.grid(row=0, column=6, padx=5)
        
        # ��� ��� ������ ���������
        list_frame = tk.Frame(self.root)
        list_frame.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)
        
        # ������������
        scrollbar = tk.Scrollbar(list_frame)
        scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
        
        # ��� ��� ������ (Treeview ������)
        self.task_tree = ttk.Treeview(
            list_frame,
            columns=("priority", "task", "due_date", "status"),
            show="headings",
            yscrollcommand=scrollbar.set,
            selectmode="browse"
        )
        
        # ������ ������
        self.task_tree.heading("priority", text="������������")
        self.task_tree.heading("task", text="��� ���")
        self.task_tree.heading("due_date", text="���������")
        self.task_tree.heading("status", text="������")
        
        self.task_tree.column("priority", width=80, anchor="center")
        self.task_tree.column("task", width=200)
        self.task_tree.column("due_date", width=100, anchor="center")
        self.task_tree.column("status", width=80, anchor="center")
        
        self.task_tree.pack(fill=tk.BOTH, expand=True)
        scrollbar.config(command=self.task_tree.yview)
        
        # ��������������� ������ ������ ������ ������
        self.task_tree.tag_configure("high", background="#ffdddd")  # ������ - ��������� ������
        self.task_tree.tag_configure("medium", background="#ffffcc")  # ������ - ��������� ������
        self.task_tree.tag_configure("low", background="#ddffdd")  # ������ - ��������� ������
        self.task_tree.tag_configure("completed", foreground="gray")  # ��������� ������
        
        # ������ ���������
        button_frame = tk.Frame(self.root)
        button_frame.pack(pady=10)
        
        delete_button = tk.Button(button_frame, text="������", command=self.delete_task)
        delete_button.pack(side=tk.LEFT, padx=5)
        
        complete_button = tk.Button(button_frame, text="������", command=self.complete_task)
        complete_button.pack(side=tk.LEFT, padx=5)
        
        # ������ ������ ��������� ���������
        self.task_tree.bind("<Double-1>", self.complete_task)
    
    def add_task(self):
        task = self.task_entry.get()
        due_date = self.due_date_entry.get()
        priority = self.priority_var.get()
        
        if not task:
            messagebox.showwarning("������", "��� ������ ������������������!")
            return
        
        # ��������� ��������� ������
        if due_date:
            try:
                datetime.strptime(due_date, "%Y-%m-%d")
            except ValueError:
                messagebox.showwarning("������", "��������� ��������� ������������ ������������. (YYYY-MM-DD ������������ ������������������)")
                return
        
        self.tasks.append({
            "task": task,
            "due_date": due_date,
            "priority": priority,
            "completed": False
        })
        
        self.update_task_tree()
        self.task_entry.delete(0, tk.END)
        self.due_date_entry.delete(0, tk.END)
        self.priority_var.set("������")  # ������������ ��������������� ������
    
    def delete_task(self):
        selected_item = self.task_tree.selection()
        if not selected_item:
            messagebox.showwarning("������", "��������� ��������� ������������������!")
            return
        
        item_index = self.task_tree.index(selected_item[0])
        del self.tasks[item_index]
        self.update_task_tree()
    
    def complete_task(self, event=None):
        selected_item = self.task_tree.selection()
        if not selected_item:
            messagebox.showwarning("������", "��������� ��������� ������������������!")
            return
        
        item_index = self.task_tree.index(selected_item[0])
        self.tasks[item_index]["completed"] = not self.tasks[item_index]["completed"]
        self.update_task_tree()
    
    def update_task_tree(self):
        # ������ ������ ������ ������
        for item in self.task_tree.get_children():
            self.task_tree.delete(item)
        
        # ������ ������ ������������
        today = datetime.now().date()
        
        # ��� ��� ������ ������������
        for task in self.tasks:
            task_text = task["task"]
            due_date = task["due_date"]
            priority = task["priority"]
            status = "������" if task["completed"] else "������ ���"
            
            # ������������ ������������ ������
            if due_date and not task["completed"]:
                try:
                    due_date_obj = datetime.strptime(due_date, "%Y-%m-%d").date()
                    if due_date_obj < today:
                        status = "��������� ������"
                except ValueError:
                    pass
            
            # Treeview��� ������ ������
            item_id = self.task_tree.insert("", "end", values=(priority, task_text, due_date, status))
            
            # ��������������� ������ ��������� ������
            if not task["completed"]:
                if priority == "������":
                    self.task_tree.item(item_id, tags=("high",))
                elif priority == "������":
                    self.task_tree.item(item_id, tags=("medium",))
                else:
                    self.task_tree.item(item_id, tags=("low",))
            
            # ��������� ��������� ������������ ������
            if task["completed"]:
                self.task_tree.item(item_id, tags=("completed",))

if __name__ == "__main__":
    root = tk.Tk()
    app = TodoApp(root)
    root.mainloop()


# data[].attributes.attachment_link.title
딮시크판 우선순위 기능 탑재 코딩 프로그램

# data[].attributes.attachment_link.readable_text


import tkinter as tk
from tkinter import StringVar

root = tk.Tk()

display_text = StringVar()
display_text.set("0")

first_number = 0
current_operator = None
operator_pressed = False

def button_click(number):
    global operator_pressed
    current_display = display_text.get()

    if operator_pressed or current_display == "0" or "Error" in current_display:
        display_text.set(str(number))
        operator_pressed = False
    else:
        display_text.set(current_display + str(number))

def operator_click(op):
    global first_number, current_operator, operator_pressed
    try:
        current_value = display_text.get()
        if "Error" in current_value or current_value == "":
            return

        first_number = int(current_value)
        current_operator = op
        operator_pressed = True

    except ValueError:
        display_text.set("Error")
        first_number = 0
        current_operator = None
        operator_pressed = False
    except Exception as e:
        display_text.set("Error")
        first_number = 0
        current_operator = None
        operator_pressed = False

def calculate():
    global first_number, current_operator, operator_pressed
    if current_operator is None or operator_pressed:
        return

    try:
        current_value = display_text.get()
        if "Error" in current_value or current_value == "":
             return

        second_number = int(current_value)
        result = 0

        if current_operator == "+":
            result = first_number + second_number
        elif current_operator == "-":
            result = first_number - second_number
        elif current_operator == "*":
            result = first_number * second_number

        display_text.set(str(result))

        first_number = result
        current_operator = None
        operator_pressed = False

    except ValueError:
        display_text.set("Error")
        first_number = 0
        current_operator = None
        operator_pressed = False
    except Exception as e:
        display_text.set("Error")
        first_number = 0
        current_operator = None
        operator_pressed = False

def clear_click():
    global first_number, current_operator, operator_pressed
    display_text.set("0")
    first_number = 0
    current_operator = None
    operator_pressed = False

root.title("������'s ������ ��������� (������ ������)")
root.geometry("300x400")
root.resizable(False, False)

e = tk.Entry(root, textvariable=display_text, font=('Arial', 20), bd=10, insertwidth=4, width=14, justify='right', state='readonly', bg='lightgray')
e.grid(row=0, column=0, columnspan=4, padx=10, pady=10, sticky='nsew')

for i in range(5):
    root.grid_rowconfigure(i, weight=1)
for i in range(4):
    root.grid_columnconfigure(i, weight=1)

button_font = ('Arial', 14)
button_padx = 5
button_pady = 5
button_sticky = 'nsew'

tk.Button(root, text='7', font=button_font, command=lambda: button_click(7)).grid(row=1, column=0, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='8', font=button_font, command=lambda: button_click(8)).grid(row=1, column=1, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='9', font=button_font, command=lambda: button_click(9)).grid(row=1, column=2, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='*', font=button_font, command=lambda: operator_click('*')).grid(row=1, column=3, padx=button_padx, pady=button_pady, sticky=button_sticky)

tk.Button(root, text='4', font=button_font, command=lambda: button_click(4)).grid(row=2, column=0, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='5', font=button_font, command=lambda: button_click(5)).grid(row=2, column=1, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='6', font=button_font, command=lambda: button_click(6)).grid(row=2, column=2, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='-', font=button_font, command=lambda: operator_click('-')).grid(row=2, column=3, padx=button_padx, pady=button_pady, sticky=button_sticky)

tk.Button(root, text='1', font=button_font, command=lambda: button_click(1)).grid(row=3, column=0, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='2', font=button_font, command=lambda: button_click(2)).grid(row=3, column=1, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='3', font=button_font, command=lambda: button_click(3)).grid(row=3, column=2, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='+', font=button_font, command=lambda: operator_click('+')).grid(row=3, column=3, padx=button_padx, pady=button_pady, sticky=button_sticky)

tk.Button(root, text='C', font=button_font, command=clear_click).grid(row=4, column=0, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='0', font=button_font, command=lambda: button_click(0)).grid(row=4, column=1, padx=button_padx, pady=button_pady, sticky=button_sticky)
tk.Button(root, text='=', font=button_font, command=calculate).grid(row=4, column=2, columnspan=2, padx=button_padx, pady=button_pady, sticky=button_sticky)

root.mainloop()

# data[].attributes.attachment_link.readable_text

from tkinter import *

root = Tk()
root.title("���������'s GUI calculator")
root.geometry("640x480")

print_value = StringVar()
print_value.set("0")

first_number = 0.0
operator = ""
waiting_for_second_number = False

def button_click(key):
    global first_number, operator, waiting_for_second_number

    current_display = print_value.get()

    if isinstance(key, int) or key == '.':
        if key == '.' and '.' in current_display and not waiting_for_second_number:
            pass
        elif waiting_for_second_number:
            if key == '.':
                 print_value.set("0.")
            else:
                 print_value.set(str(key))
            waiting_for_second_number = False
        elif current_display == "0" and key != '.':
             print_value.set(str(key))
        else:
            print_value.set(current_display + str(key))

    elif key == 'C':
        print_value.set("0")
        first_number = 0.0
        operator = ""
        waiting_for_second_number = False

    elif key == '=':
        if operator != "" and not waiting_for_second_number:
            try:
                second_number = float(current_display)
                perform_calculation(second_number)
                operator = ""
                waiting_for_second_number = True

            except ValueError:
                 print_value.set("Error!")
                 reset_calculator_state()
            except Exception as e:
                 print_value.set("Error!")
                 reset_calculator_state()


def operator_click(op):
    global first_number, operator, waiting_for_second_number

    current_display = print_value.get()

    if current_display == "" or current_display == "Error!":
         return

    try:
        current_value = float(current_display)

        if operator != "" and not waiting_for_second_number:
             perform_calculation(current_value)
             operator = op

        elif operator == "" :
            first_number = current_value
            operator = op
            waiting_for_second_number = True

        elif operator != "" and waiting_for_second_number:
             operator = op

    except ValueError:
         print_value.set("Error!")
         reset_calculator_state()


def perform_calculation(second_number):
    global first_number, operator, waiting_for_second_number
    result = 0.0

    try:
        if operator == '+':
            result = first_number + second_number
        elif operator == '-':
            result = first_number - second_number
        elif operator == '*':
            result = first_number * second_number
        elif operator == '/':
            if second_number == 0:
                print_value.set("Error!")
                reset_calculator_state()
                return
            result = first_number / second_number

        if result == int(result):
             print_value.set(str(int(result)))
        else:
             print_value.set(str(result))

        first_number = result
        waiting_for_second_number = True

    except Exception as e:
        print_value.set("Error!")
        reset_calculator_state()


def reset_calculator_state():
    global first_number, operator, waiting_for_second_number
    first_number = 0.0
    operator = ""
    waiting_for_second_number = False


e = Entry(root, width = 20, textvariable=print_value, font=('Arial', 20), bd=5, justify='right', state='readonly')
e.grid(row = 0, column=0, columnspan=4, pady=10, padx=10)


button = Button(root, text='7',width=10,height=5,
command=lambda: button_click(7)).grid(row=1, column=0)
button = Button(root, text='8',width=10,height=5,
command=lambda: button_click(8)).grid(row=1, column=1)
button = Button(root, text='9',width=10,height=5,
command=lambda: button_click(9)).grid(row=1, column=2)
button = Button(root, text='*',width=10,height=5,
command=lambda: operator_click('*')).grid(row=1, column=3)

button = Button(root, text='4',width=10,height=5,
command=lambda: button_click(4)).grid(row=2, column=0)
button = Button(root, text='5',width=10,height=5,
command=lambda: button_click(5)).grid(row=2, column=1)
button = Button(root, text='6',width=10,height=5,
command=lambda: button_click(6)).grid(row=2, column=2)
button = Button(root, text='-',width=10,height=5,
command=lambda: operator_click('-')).grid(row=2, column=3)

button = Button(root, text='1',width=10,height=5,
command=lambda: button_click(1)).grid(row=3, column=0)
button = Button(root, text='2',width=10,height=5,
command=lambda: button_click(2)).grid(row=3, column=1)
button = Button(root, text='3',width=10,height=5,
command=lambda: button_click(3)).grid(row=3, column=2)
button = Button(root, text='+',width=10,height=5,
command=lambda: operator_click('+')).grid(row=3, column=3)

button = Button(root, text='0',width=10,height=5,
command=lambda: button_click(0)).grid(row=4, column=0)
button = Button(root, text='.',width=10,height=5,
command=lambda: button_click('.')).grid(row=4, column=1)
button = Button(root, text='C',width=10,height=5,
command=lambda: button_click('C')).grid(row=4, column=2)
button = Button(root, text='=',width=10,height=5,
command=lambda: button_click('=')).grid(row=4, column=3)

root.mainloop()

'''
from tkinter import *

root = Tk()
root.title("���������'s GUI")
root.geometry("640x480")

class Burger:

    def __init__(self, name): 
        self.name = name

    def show(self):
        print(f"��� ������������ {self.name}���������.")

cheeseburger = Burger("������������")
bulgogi = Burger("���������������")
H_B = Burger("��������� ������")
cheeseburger.show() 
bulgogi.show()   
H_B.show()

root.mainloop()



from tkinter import *

class MyApp:

    def __init__(self, root):
        self.root = root
        self.root.title("������ ������ GUI")
        self.count = 0  

        self.label = Label(root, text="��������� ���������������")
        self.label.pack()

        self.button = Button(root, text="������!", command=self.on_click)
        self.button.pack()

    def on_click(self):
        self.count += 1
        self.label.config(text=f"{self.count}��� ���������������!")

root = Tk()
app = MyApp(root)
app2 = MyApp(root) 
root.mainlop()

import tkinter as tk
from tkinter import simpledialog, messagebox

class TodoListApp:

    def __init__(self, root):
        self.root = root
        self.root.title("��� ��������� ��������������� ���")
        self.root.geometry("400x500") 
        self.tasks = [] 

     
        self.task_entry = tk.Entry(root, width=30, font=('Arial', 12))
        self.task_entry.grid(row=0, column=0, padx=10, pady=10, sticky="ew") 
       
        self.add_button = tk.Button(root, text="������", font=('Arial', 10), command=self.add_task)
        self.add_button.grid(row=0, column=1, padx=5, pady=10) 

   
        self.task_listbox = tk.Listbox(root, width=50, height=15,
                                       font=('Arial', 12), selectmode=tk.SINGLE) 
    
        self.task_listbox.grid(row=1, column=0, columnspan=2, padx=10,
                               pady=5, sticky="nsew") 

       
        self.delete_button = tk.Button(root, text="������", font=('Arial', 10), command=self.delete_task)
        self.delete_button.grid(row=2, column=0, padx=10, pady=10, sticky="ew") 

       
        self.complete_button = tk.Button(root, text="������/���������", font=('Arial', 10),
                                         command=self.toggle_complete)
        self.complete_button.grid(row=2, column=1, padx=10, pady=10, sticky="ew") 

        
        self.root.grid_columnconfigure(0, weight=1) 
        self.root.grid_rowconfigure(1, weight=1)

        
        self.update_listbox()

  
    def add_task(self):
        task_text = self.task_entry.get() 
        if task_text != "": 
            self.tasks.append({"task": task_text, "completed": False})
            self.task_entry.delete(0, tk.END) 
            self.update_listbox() 
        else:
            messagebox.showwarning("������!", "��� ������ ������������������!") 

  
    def delete_task(self):
        try:
            
            selected_index = self.task_listbox.curselection()[0]
            
            del self.tasks[selected_index]
            self.update_listbox() 
        except IndexError: 
            messagebox.showwarning("������!", "��������� ��� ������ ������������������!") 

    
    def toggle_complete(self):
        try:
            
            selected_index = self.task_listbox.curselection()[0]
            
            self.tasks[selected_index]["completed"] = not self.tasks[selected_index]["completed"]
            self.update_listbox()
        except IndexError: 
            messagebox.showwarning("������!", "��������� ��������� ��� ������ ������������������!") # ������ ��� ������ ��������� ���������! ������

    
    def update_listbox(self):
        self.task_listbox.delete(0, tk.END)
       
        for task in self.tasks:
           
            status = "���" if task["completed"] else "���" 
            display_text = f"{status} {task['task']}" 
            self.task_listbox.insert(tk.END, display_text) 


if __name__ == "__main__": 
    root = tk.Tk()
    app = TodoListApp(root)
    root.mainloop() 
'''







# data[].attributes.body
import tkinter as tk

from tkinter import messagebox

# 계산기 앱 클래스 시작!

class CalculatorApp(tk.Tk):

def init(self):

super().__init__() # tk.Tk 창 초기화!

self.title("간단 멋진 계산기 ✨")

self.geometry("300x400") # 창 크기 설정

# 계산 결과를 보여줄 화면 (Entry 위젯 사용)

# state='readonly'로 해서 사용자가 직접 입력 못하게 막자

self.display = tk.Entry(self, width=20, font=('Arial', 20), bd=10, insertwidth=2,

bg="white", justify='right', state='readonly')

self.display.grid(row=0, column=0, columnspan=4, pady=10, padx=10) # 맨 위에 넓게 배치!

# 버튼들을 만들자!

self.create_buttons()

# 현재 계산식 저장 변수

self.current_expression = ""

def create_buttons(self):

# 버튼에 표시될 텍스트 리스트

button_texts = [

('7', 1, 0), ('8', 1, 1), ('9', 1, 2), ('/', 1, 3),

('4', 2, 0), ('5', 2, 1), ('6', 2, 2), ('*', 2, 3),

('1', 3, 0), ('2', 3, 1), ('3', 3, 2), ('-', 3, 3),

('0', 4, 0), ('.', 4, 1), ('C', 4, 2), ('+', 4, 3),

('=', 5, 0) # '=' 버튼은 좀 특별하게 아래에 따로!

]

# 버튼들을 배치하자 (grid 사용)

for (text, row, column) in button_texts:

# '=' 버튼은 좀 더 크게 만들자!

if text == '=':

button = tk.Button(self, text=text, width=10, height=2, font=('Arial', 15),

command=lambda t=text: self.on_button_click(t))

button.grid(row=row, column=column, columnspan=4, pady=5, padx=5, sticky="nsew") # nsew로 늘어나게!

else:

button = tk.Button(self, text=text, width=5, height=2, font=('Arial', 15),

command=lambda t=text: self.on_button_click(t)) # 버튼 누르면 on_button_click 호출!

button.grid(row=row, column=column, pady=5, padx=5, sticky="nsew") # nsew로 늘어나게!

# 창 크기 변경 시 버튼들도 같이 늘어나도록 설정

for i in range(6): # 0행(display)부터 5행('=')까지

self.grid_rowconfigure(i, weight=1)

for i in range(4): # 0열부터 3열까지

self.grid_columnconfigure(i, weight=1)

# 버튼이 눌렸을 때 호출되는 함수

def on_button_click(self, char):

# Display 위젯은 readonly 상태라 내용을 직접 수정할 수 없어.

# 그래서 일단 normal 상태로 바꾸고, 내용 수정하고, 다시 readonly로 돌려야 해.

self.display.config(state='normal')

if char == 'C': # 'C' 버튼이면 초기화!

self.current_expression = ""

self.display.delete(0, tk.END)

elif char == '=': # '=' 버튼이면 계산!

try:

# eval 함수로 현재 계산식 계산 (문자열을 코드로 실행!)

# 주의: eval은 사용자 입력을 그대로 실행하므로 보안상 위험할 수 있지만,

# 이 계산기는 버튼 입력만 받아서 비교적 안전해요!

result = str(eval(self.current_expression))

self.display.delete(0, tk.END)

self.display.insert(0, result)

self.current_expression = result # 다음 계산을 위해 결과값을 저장해두자

except ZeroDivisionError: # 0으로 나누면?

messagebox.showerror("오류!", "0으로 나눌 수 없어요! 😵‍💫")

self.display.delete(0, tk.END)

self.current_expression = "" # 오류 났으니 초기화

except SyntaxError: # 잘못된 계산식 입력이면?

messagebox.showerror("오류!", "잘못된 계산식이에요! 😟")

self.display.delete(0, tk.END)

self.current_expression = "" # 오류 났으니 초기화

except Exception as e: # 그 외 다른 오류

messagebox.showerror("오류!", f"알 수 없는 오류 발생! 😭\n{e}")

self.display.delete(0, tk.END)

self.current_expression = "" # 오류 났으니 초기화

else: # 숫자나 연산자 버튼이면

self.current_expression += str(char) # 계산식에 추가!

self.display.insert(tk.END, str(char)) # 화면에도 추가!

self.display.config(state='readonly') # 다시 readonly 상태로!

# 앱 실행!

if name == "__main__":

app = CalculatorApp()

app.mainloop() # 창이 계속 떠 있도록 메인 루프 시작!

# data[].attributes.attachment_link.readable_text
from tkinter import *

class TodoApp:
    def __init__(self, root):
        self.root = root
        self.root.title("������ ������ ������ ���������")

       
        self.todos = []

        self.label = Label(root, text= "������ ������������ ������������������")

        self.entry = Entry(root, width=30)
        self.entry.pack(pady=5)

        self.add_button = Button(root, text="������", width=10, command=self.add_todo)
        self.add_button.pack(pady=2)

        self.delete_button = Button(root, text="������", width=10, command=self.delete_todo)
        self.delete_button.pack(pady=2)

        self.complete_button = Button(root, text="������", width=10, command=self.complete_todo)
        self.complete_button.pack(pady=2)

        self.listbox = Listbox(root, width=40, height=10)
        self.listbox.pack(pady=10)

    def add_todo(self):
        todo = self.entry.get().strip()
        if todo:
            self.todos.append({'task': todo, 'done': False})
            self.update_listbox()
            self.entry.delete(0, END)

    def delete_todo(self):
        selected = self.listbox.curselection()
        if selected:
            idx = selected[0]
            del self.todos[idx]
            self.update_listbox()

    def complete_todo(self):
        selected = self.listbox.curselection()
        if selected:
            idx = selected[0]
            self.todos[idx]['done'] = not self.todos[idx]['done']
            self.update_listbox()

    def update_listbox(self):
        self.listbox.delete(0, END)
        for todo in self.todos:
            status = "[������]" if todo['done'] else "[������]"
            self.listbox.insert(END, f"{status} {todo['task']}")

if __name__ == "__main__":
    root = Tk()
    app = TodoApp(root)
    root.mainloop()

# data[].attributes.attachment_link.readable_text
'''
from tkinter import *

root = Tk()
root.title("���������'s GUI calculator")
root.geometry("640x480")

print_value = StringVar()
print_value.set("0")

first_number = 0.0
operator = ""
waiting_for_second_number = False

def button_click(key):
    global first_number, operator, waiting_for_second_number

    current_display = print_value.get()

    if isinstance(key, int) or key == '.':
        if key == '.' and '.' in current_display and not waiting_for_second_number:
            pass
        elif waiting_for_second_number:
            if key == '.':
                 print_value.set("0.")
            else:
                 print_value.set(str(key))
            waiting_for_second_number = False
        elif current_display == "0" and key != '.':
             print_value.set(str(key))
        else:
            print_value.set(current_display + str(key))

    elif key == 'C':
        print_value.set("0")
        first_number = 0.0
        operator = ""
        waiting_for_second_number = False

    elif key == '=':
        if operator != "" and not waiting_for_second_number:
            try:
                second_number = float(current_display)
                perform_calculation(second_number)
                operator = ""
                waiting_for_second_number = True

            except ValueError:
                 print_value.set("Error!")
                 reset_calculator_state()
            except Exception as e:
                 print_value.set("Error!")
                 reset_calculator_state()


def operator_click(op):
    global first_number, operator, waiting_for_second_number

    current_display = print_value.get()

    if current_display == "" or current_display == "Error!":
         return

    try:
        current_value = float(current_display)

        if operator != "" and not waiting_for_second_number:
             perform_calculation(current_value)
             operator = op

        elif operator == "" :
            first_number = current_value
            operator = op
            waiting_for_second_number = True

        elif operator != "" and waiting_for_second_number:
             operator = op

    except ValueError:
         print_value.set("Error!")
         reset_calculator_state()


def perform_calculation(second_number):
    global first_number, operator, waiting_for_second_number
    result = 0.0

    try:
        if operator == '+':
            result = first_number + second_number
        elif operator == '-':
            result = first_number - second_number
        elif operator == '*':
            result = first_number * second_number
        elif operator == '/':
            if second_number == 0:
                print_value.set("Error!")
                reset_calculator_state()
                return
            result = first_number / second_number

        if result == int(result):
             print_value.set(str(int(result)))
        else:
             print_value.set(str(result))

        first_number = result
        waiting_for_second_number = True

    except Exception as e:
        print_value.set("Error!")
        reset_calculator_state()


def reset_calculator_state():
    global first_number, operator, waiting_for_second_number
    first_number = 0.0
    operator = ""
    waiting_for_second_number = False


e = Entry(root, width = 20, textvariable=print_value, font=('Arial', 20), bd=5, justify='right', state='readonly')
e.grid(row = 0, column=0, columnspan=4, pady=10, padx=10)


button = Button(root, text='7',width=10,height=5,
command=lambda: button_click(7)).grid(row=1, column=0)
button = Button(root, text='8',width=10,height=5,
command=lambda: button_click(8)).grid(row=1, column=1)
button = Button(root, text='9',width=10,height=5,
command=lambda: button_click(9)).grid(row=1, column=2)
button = Button(root, text='*',width=10,height=5,
command=lambda: operator_click('*')).grid(row=1, column=3)

button = Button(root, text='4',width=10,height=5,
command=lambda: button_click(4)).grid(row=2, column=0)
button = Button(root, text='5',width=10,height=5,
command=lambda: button_click(5)).grid(row=2, column=1)
button = Button(root, text='6',width=10,height=5,
command=lambda: button_click(6)).grid(row=2, column=2)
button = Button(root, text='-',width=10,height=5,
command=lambda: operator_click('-')).grid(row=2, column=3)

button = Button(root, text='1',width=10,height=5,
command=lambda: button_click(1)).grid(row=3, column=0)
button = Button(root, text='2',width=10,height=5,
command=lambda: button_click(2)).grid(row=3, column=1)
button = Button(root, text='3',width=10,height=5,
command=lambda: button_click(3)).grid(row=3, column=2)
button = Button(root, text='+',width=10,height=5,
command=lambda: operator_click('+')).grid(row=3, column=3)

button = Button(root, text='0',width=10,height=5,
command=lambda: button_click(0)).grid(row=4, column=0)
button = Button(root, text='.',width=10,height=5,
command=lambda: button_click('.')).grid(row=4, column=1)
button = Button(root, text='C',width=10,height=5,
command=lambda: button_click('C')).grid(row=4, column=2)
button = Button(root, text='=',width=10,height=5,
command=lambda: button_click('=')).grid(row=4, column=3)

root.mainloop()


from tkinter import *

root = Tk()
root.title("���������'s GUI")
root.geometry("640x480")

class Burger:

    def __init__(self, name): 
        self.name = name

    def show(self):
        print(f"��� ������������ {self.name}���������.")

cheeseburger = Burger("������������")
bulgogi = Burger("���������������")
H_B = Burger("��������� ������")
cheeseburger.show() 
bulgogi.show()   
H_B.show()

root.mainloop()



from tkinter import *

class MyApp:

    def __init__(self, root):
        self.root = root
        self.root.title("������ ������ GUI")
        self.count = 0  

        self.label = Label(root, text="��������� ���������������")
        self.label.pack()

        self.button = Button(root, text="������!", command=self.on_click)
        self.button.pack()

    def on_click(self):
        self.count += 1
        self.label.config(text=f"{self.count}��� ���������������!")

root = Tk()
app = MyApp(root)
app2 = MyApp(root) 
root.mainlop()

'''
import tkinter as tk
from tkinter import simpledialog, messagebox

class TodoListApp:

    def __init__(self, root):
        self.root = root
        self.root.title("��� ��������� ��������������� ���")
        self.root.geometry("400x500") 
        self.tasks = [] 

     
        self.task_entry = tk.Entry(root, width=30, font=('Arial', 12))
        self.task_entry.grid(row=0, column=0, padx=10, pady=10, sticky="ew") 
       
        self.add_button = tk.Button(root, text="������", font=('Arial', 10), command=self.add_task)
        self.add_button.grid(row=0, column=1, padx=5, pady=10) 

   
        self.task_listbox = tk.Listbox(root, width=50, height=15,
                                       font=('Arial', 12), selectmode=tk.SINGLE) 
    
        self.task_listbox.grid(row=1, column=0, columnspan=2, padx=10,
                               pady=5, sticky="nsew") 

       
        self.delete_button = tk.Button(root, text="������", font=('Arial', 10), command=self.delete_task)
        self.delete_button.grid(row=2, column=0, padx=10, pady=10, sticky="ew") 

       
        self.complete_button = tk.Button(root, text="������/���������", font=('Arial', 10),
                                         command=self.toggle_complete)
        self.complete_button.grid(row=2, column=1, padx=10, pady=10, sticky="ew") 

        
        self.root.grid_columnconfigure(0, weight=1) 
        self.root.grid_rowconfigure(1, weight=1)

        
        self.update_listbox()

  
    def add_task(self):
        task_text = self.task_entry.get() 
        if task_text != "": 
            self.tasks.append({"task": task_text, "completed": False})
            self.task_entry.delete(0, tk.END) 
            self.update_listbox() 
        else:
            messagebox.showwarning("������!", "��� ������ ������������������!") 

  
    def delete_task(self):
        try:
            
            selected_index = self.task_listbox.curselection()[0]
            
            del self.tasks[selected_index]
            self.update_listbox() 
        except IndexError: 
            messagebox.showwarning("������!", "��������� ��� ������ ������������������!") 

    
    def toggle_complete(self):
        try:
            
            selected_index = self.task_listbox.curselection()[0]
            
            self.tasks[selected_index]["completed"] = not self.tasks[selected_index]["completed"]
            self.update_listbox()
        except IndexError: 
            messagebox.showwarning("������!", "��������� ��������� ��� ������ ������������������!") # ������ ��� ������ ��������� ���������! ������

    
    def update_listbox(self):
        self.task_listbox.delete(0, tk.END)
       
        for task in self.tasks:
           
            status = "���" if task["completed"] else "���" 
            display_text = f"{status} {task['task']}" 
            self.task_listbox.insert(tk.END, display_text) 


if __name__ == "__main__": 
    root = tk.Tk()
    app = TodoListApp(root)
    root.mainloop() 








# data[].attributes.attachment_link.readable_text
import tkinter as tk
import random
import time

class ReactionGameApp:
    def __init__(self, root):
        self.root = root
        self.root.title("������������ ������������")
        self.root.geometry("500x400")
        self.root.resizable(False, False)

        self.is_waiting = False
        self.is_ready = False
        self.start_time = 0
        self.scheduled_color_change = None

        self.label = tk.Label(root, text="������������ ������ ������",bg='lightblue', fg='navy')
        self.label.pack(pady=50)

        self.result_label = tk.Label(root, text="", bg='lightblue', fg='darkgreen')
        self.result_label.pack(pady=20)

        self.root.bind("<Button-1>", self.handle_click) 

    def handle_click(self, event):
        if not self.is_waiting and not self.is_ready:
            self.start_game()
        elif self.is_ready:
            self.measure_reaction_time()
        elif self.is_waiting:
            self.false_start()

    def start_game(self):
        self.root.configure(bg='lightblue')
        self.label.config(text="��������������� ��������� ������������")
        self.result_label.config(text="",bg="lightblue") 

        self.is_waiting = True 
        self.is_ready = False 

       
        delay = random.randint(1000, 4000) 
        self.scheduled_color_change = self.root.after(delay, self.change_color_to_green)


    def change_color_to_green(self):
        if self.is_waiting: 
            self.root.configure(bg='lightgreen') 
            self.label.config(text="������", fg='darkred') 
   

            self.is_waiting = False
            self.is_ready = True 
            self.start_time = time.time()

   
    def measure_reaction_time(self):
        if self.is_ready: 
            end_time = time.time() 
            reaction_time = end_time - self.start_time 

            self.result_label.config(text=f"��������� ������ ��������� {reaction_time:.3f} ��� ���������")
            self.label.config(text="������ ��������� ������ ������������ ������", fg='navy')
           

            self.is_ready = False 



    def false_start(self):
        if self.is_waiting:

            self.result_label.config(text="���������������������.", fg='red')
            self.label.config(text="������ ��������� ������ ������������ ������", fg='navy')
            
            if self.scheduled_color_change: 
                self.root.after_cancel(self.scheduled_color_change)
                self.scheduled_color_change = None

            self.is_waiting = False 




if __name__ == "__main__":
    root = tk.Tk()
    app = ReactionGameApp(root)
    root.mainloop() 

# data[].attributes.attachment_link.readable_text
from tkinter import*

root=Tk()
root.title('��������� ���������')
root.geometry('320x390')

print_value = StringVar()
print_value.set('0')

e = Entry(root, width=30, textvariable=print_value, justify='right')
e.grid(row=0, column=0, columnspan=4, padx=10, pady=10)

num1 = 0
operator = 'none'
is_new_number = True

def button_click(key):
    global print_value, is_new_number
    current_display = print_value.get()
    key_str = str(key)
    if is_new_number or current_display == '0':
        print_value.set(key_str)
        is_new_number = False
    else:
        print_value.set(current_display + key_str)

def operator_click(op):
    global num1, operator, print_value, is_new_number

    try:
        current_value = int(print_value.get())
    except ValueError:
        print_value.set('Error')
        num1 = 0
        operator = 'none'
        is_new_number = True
        return

    if operator != 'none':
        if operator == '+':
            num1 += current_value
        elif operator == '-':
            num1 -= current_value
        elif operator == '*':
             num1 *= current_value
    else:
        num1 = current_value

    if op == '=':
        print_value.set(str(num1))
        operator = 'none'
        is_new_number = True
    else:
        print_value.set(str(num1))
        operator = op
        is_new_number = True

def button_clear():
    global num1, operator, print_value, is_new_number
    num1 = 0
    operator = 'none'
    print_value.set('0')
    is_new_number = True

Button(root, text='7',width=10,height=5,
command=lambda: button_click(7)).grid(row=1, column=0, sticky="nsew")
Button(root, text='8',width=10,height=5,
command=lambda: button_click(8)).grid(row=1, column=1, sticky="nsew")
Button(root, text='9',width=10,height=5,
command=lambda: button_click(9)).grid(row=1, column=2, sticky="nsew")
Button(root, text='*',width=10,height=5,
command=lambda: operator_click('*')).grid(row=1, column=3, sticky="nsew")

Button(root, text='4',width=10,height=5,
command=lambda: button_click(4)).grid(row=2, column=0, sticky="nsew")
Button(root, text='5',width=10,height=5,
command=lambda: button_click(5)).grid(row=2, column=1, sticky="nsew")
Button(root, text='6',width=10,height=5,
command=lambda: button_click(6)).grid(row=2, column=2, sticky="nsew")
Button(root, text='-',width=10,height=5,
command=lambda: operator_click('-')).grid(row=2, column=3, sticky="nsew")

Button(root, text='1',width=10,height=5,
command=lambda: button_click(1)).grid(row=3, column=0, sticky="nsew")
Button(root, text='2',width=10,height=5,
command=lambda: button_click(2)).grid(row=3, column=1, sticky="nsew")
Button(root, text='3',width=10,height=5,
command=lambda: button_click(3)).grid(row=3, column=2, sticky="nsew")
Button(root, text='+',width=10,height=5,
command=lambda: operator_click('+')).grid(row=3, column=3, sticky="nsew")

Button(root, text='0',width=10,height=5,
command=lambda: button_click(0)).grid(row=4, column=0, sticky="nsew")

Button(root, text='C',width=10,height=5,
command=button_clear).grid(row=4, column=2, sticky="nsew")
Button(root, text='=',width=10,height=5,
command=lambda: operator_click('=')).grid(row=4, column=3, sticky="nsew")

for i in range(4):
    root.grid_columnconfigure(i, weight=1)

for i in range(1, 5):
    root.grid_rowconfigure(i, weight=1)

root.mainloop()

# data[].attributes.headline
말파가 궁쓰는 상황에 점멸로 피하기

# data[].attributes.subject
말파가 궁쓰는 상황에 점멸로 피하기

# data[].attributes.body
자동차 조종

# data[].attributes.body
import pygame
class MyApp:
    def __init__(self,SCREEN_WIDTH,SCREEN_HEIGHT,fps):
        self.SCREEN_WIDTH=SCREEN_WIDTH
        self.SCREEN_HEIGHT=SCREEN_HEIGHT
        self.fps=fps
        self.car=pygame.image.load("car.png")
        self.car=pygame.transform.scale(self.car, (50, 100))
        self.clock=pygame.time.Clock()
        self.screen=pygame.display.set_mode((self.SCREEN_WIDTH,self.SCREEN_HEIGHT))
        self.running=True
        self.car_Rect = self.car.get_rect()
        self.car_Rect.centerx=SCREEN_WIDTH / 2
        self.car_Rect.centery=SCREEN_HEIGHT-100
    def start(self):
        dx=0
        dy=0
        pygame.init()
        self.screen
        while self.running:
            self.clock.tick(self.fps)
            for event in pygame.event.get():
                if event.type==pygame.QUIT:
                    self.running=False
                pygame.display.flip()
                self.screen.fill((255,255,255))
                self.screen.blit(self.car, self.car_Rect)
                if event.type == pygame.KEYDOWN:
                    if event.key==pygame.K_LEFT:
                        dx=-5
                    if event.key==pygame.K_RIGHT:
                        dx=5
                    if event.key==pygame.K_UP:
                        dy=-5
                    if event.key==pygame.K_DOWN:
                        dy=5
                self.car_Rect.centerx +=dx
                self.car_Rect.centery +=dy
                if event.type == pygame.KEYUP:
                    if event.key==pygame.K_LEFT:
                        dx=0
                    if event.key==pygame.K_RIGHT:
                        dx=0
                    if event.key==pygame.K_UP:
                        dy=0
                    if event.key==pygame.K_DOWN:
                        dy=-0

app=MyApp(400,500,120)
app.start()

# data[].attributes.attachment_link.readable_text

import pygame
class MyApp:
    def __init__(self,SCREEN_WIDTH,SCREEN_HEIGHT,fps):
        self.SCREEN_WIDTH=SCREEN_WIDTH
        self.SCREEN_HEIGHT=SCREEN_HEIGHT
        self.fps=fps
        self.car=pygame.image.load("car.png")
        self.car=pygame.transform.scale(self.car, (50, 100))
        self.clock=pygame.time.Clock()
        self.screen=pygame.display.set_mode((self.SCREEN_WIDTH,self.SCREEN_HEIGHT))
        self.running=True
        self.car_Rect = self.car.get_rect()
        self.car_Rect.centerx=SCREEN_WIDTH / 2
        self.car_Rect.centery=SCREEN_HEIGHT-100
    def start(self):
        dx=0
        dy=0
        pygame.init()
        self.screen
        while self.running:
            self.clock.tick(self.fps)
            for event in pygame.event.get():
                if event.type==pygame.QUIT:
                    self.running=False
                pygame.display.flip()
                self.screen.fill((255,255,255))
                self.screen.blit(self.car, self.car_Rect)
                if event.type == pygame.KEYDOWN:
                    if event.key==pygame.K_LEFT:
                        dx=-5
                    if event.key==pygame.K_RIGHT:
                        dx=5
                    if event.key==pygame.K_UP:
                        dy=-5
                    if event.key==pygame.K_DOWN:
                        dy=5
                self.car_Rect.centerx +=dx
                self.car_Rect.centery +=dy
                if event.type == pygame.KEYUP:
                    if event.key==pygame.K_LEFT:
                        dx=0
                    if event.key==pygame.K_RIGHT:
                        dx=0
                    if event.key==pygame.K_UP:
                        dy=0
                    if event.key==pygame.K_DOWN:
                        dy=-0

app=MyApp(400,500,120)
app.start()

# data[].attributes.attachment_link.readable_text
from tkinter import *

root = Tk()
root.title("���������'s GUI")
root.geometry("800x600")


tk_image = PhotoImage(file = "���������.png").subsample(2,2)
tk_image2 = PhotoImage(file = "���������������.png").subsample(2,2)
cvs = Canvas(root, highlightthickness = 0)
cvs.pack(fill = BOTH, expand = True)

img_id = cvs.create_image(400, 300, anchor = CENTER, image = tk_image)
img_target = cvs.create_image(400, 300, anchor = CENTER, image = tk_image2)
'''
def keyPressHandler(event):

    img_w = tk_image.width()/2
    img_h = tk_image.height()/2
    cvs_w = cvs.winfo_width()
    cvs_h = cvs.winfo_height()
    
    x,y = cvs.coords(img_id)
    if x >= img_w+10 and event.keysym == "Left":
        cvs.move(img_id, -10,0)
       
    elif x <= cvs_w - img_w and event.keysym == "Right":
        cvs.move(img_id, 10,0)
       
    elif y >= img_h + 10 and event.keysym == "Up":
        cvs.move(img_id, 0,-10)
        
    elif y <= cvs_h - img_w and event.keysym == "Down":
        cvs.move(img_id,0,10)
root.bind("<KeyPress>",keyPressHandler )
'''
'''
keys = set()
def keyPressHandler(event):
    keys.add(event.keysym)

def keyReleaseHandler(event):
    keys.discard(event.keysym)


root.bind("<KeyPress>", keyPressHandler )
root.bind("<KeyRelease>", keyReleaseHandler)
def gameLoop():

    img_w = tk_image.width()/2
    img_h = tk_image.height()/2
    cvs_w = cvs.winfo_width()
    cvs_h = cvs.winfo_height()
    
    x,y = cvs.coords(img_id)
    if x >= img_w+10 and "Left" in keys:
        cvs.move(img_id, -10,0)
       
    elif x <= cvs_w - img_w and "Right" in keys:
        cvs.move(img_id, 10,0)
       
    elif y >= img_h + 10 and "Up" in keys:
        cvs.move(img_id, 0,-10)
        
    elif y <= cvs_h - img_w and "Down" in keys:
        cvs.move(img_id,0,10)
        
    root.update()
    root.after(20, gameLoop)
    
root.after(20, gameLoop)
root.mainloop()

gauge_length = 300
gauge_height = 30
gauge_value = 0

gauge = cvs.create_rectangle(50, 100, 50+gauge_length, 100+gauge_height, fill = "lightgray")
cvs.create_text(200, 80, text = "Press and hold Spacebar to fill the gauge", font = ("Arial", 12))

is_space_pressed = False
def fillGauge():
    global gauge_value
    if is_space_pressed and gauge_value < gauge_length:
        gauge_value +=5
        cvs.coords(gauge,50,100,50+gauge_value, 100+gauge_height)
        root.after(100, fillGauge)
    elif not is_space_pressed:
        cvs.coords(gauge,50,100,50+gauge_value, 100+gauge_height)

def resetGauge():
    global gauge_value
    gauge_value = 0
    cvs.coords(gauge,50,100,50+gauge_value, 100+gauge_height)

def keyPressHandler(event):
    global is_space_pressed
    if event.keysym == 'space':
        is_space_pressed = True
        fillGauge()
    elif event.keysym == 'Return':
        resetGauge()
def keyReleaseHandler(event):
    global is_space_pressed
    if event.keysym == 'space':
        is_space_pressed = False
        print(f"Final gauge value: {gauge_value}")
root.bind("<KeyPress>", keyPressHandler )
root.bind("<KeyRelease>", keyReleaseHandler)

def mouseMoveHandler(event):
    cvs.coords(img_id, event.x, event.y)
root.bind("<Motion>", mouseMoveHandler)
obj_size = 30
tar_ball_size = 40
def collision():
    obj_x, obj_y = cvs.coords(img_id)
    tar_x, tar_y = cvs.coords(img_target)

    dx = obj_x - tar_x
    dy = obj_y - tar_y
    distance= (dx * dx + dy*dy)**0.5
    return distance < (obj_size/2 + tar_ball_size/2)
def mouseMoveHandler(event):

    cvs.coords(img_id, event.x, event.y)

    if collision():

        cvs.itemconfig(img_target, state=HIDDEN)


root.bind("<Motion>", mouseMoveHandler)

'''


# data[].attributes.body
to do list

# data[].attributes.attachment_link.readable_text
from tkinter import *


class App:
    def __init__(self,root):
        self.root=root
        self.label=Label(root,text="To Do List")
        self.label.grid(row=0,column=0,columnspan=6)
        self.listbox=Listbox(root,selectmode="single",height=15,width=70)
        self.listbox.grid(row=1,column=0,columnspan=6)
        self.e=Entry(root,width=50)
        self.e.grid(row=2,column=0,columnspan=5)
        self.btn1=Button(root,text="������",command=self.add)
        self.btn1.grid(row=2,column=4,columnspan=6)
        self.btn2=Button(root,text="������",command=self.de)
        self.btn2.grid(row=3,column=4,columnspan=6)
        self.btn3=Button(root,text="������",command=self.per)
        self.btn3.grid(row=3,column=5,columnspan=6)
    def add(self):
        self.listbox.insert(END,f"{self.e.get()}")
        self.e.delete(0,END)
    def de(self):
        if self.listbox.curselection()[0]>=0:
            self.listbox.delete(self.listbox.curselection())
    def per(self):
        self.listbox.itemconfig(self.listbox.curselection(), fg="gray")

root=Tk()
app=App(root)
root.mainloop()

# data[].attributes.attachment_link.readable_text
from tkinter import *

root = Tk()
root.title("������'s GUI")
root.geometry('800x600')

tk_image = PhotoImage(file="������.png").subsample(2,2)

cvs = Canvas(root, highlightthickness=0)
cvs.pack(fill=BOTH, expand=True)

img_id = cvs.create_image(400, 300, anchor=CENTER, image=tk_image)
'''
def keyPressHandler(event):
    x, y = cvs.coords(img_id)

    img_w = tk_image.width()/2
    img_h = tk_image.height()/2
    cvs_w = cvs.winfo_width()
    cvs_h = cvs.winfo_height()

    
    if event.keysym == 'Left':
        if x >= img_w + 10:
            cvs.move(img_id, -10, 0)
    elif event.keysym == 'Right':
        if x <= cvs_w - img_w - 10:
            cvs.move(img_id, 10, 0)
    elif event.keysym == 'Up':
        if y >= img_h + 10:
            cvs.move(img_id, 0, -10)
    elif event.keysym == 'Down':
        if y <= cvs_h - img_h - 10:
            cvs.move(img_id, 0, 10)
'''


keys = set()

def keyPressHandler(event):
    keys.add(event.keysym)

def keyReleaseHandler(event):
    keys.discard(event.keysym)


root.bind('<KeyRelease>', keyReleaseHandler)
root.bind("<KeyPress>", keyPressHandler)


def gameLoop():
    x, y = cvs.coords(img_id)

    img_w = tk_image.width()/2
    img_h = tk_image.height()/2
    cvs_w = cvs.winfo_width()
    cvs_h = cvs.winfo_height()

    
    if 'Left' in keys:
        if x >= img_w + 10:
            cvs.move(img_id, -10, 0)
    elif 'Right' in keys:
        if x <= cvs_w - img_w - 10:
            cvs.move(img_id, 10, 0)
    elif 'Up' in keys:
        if y >= img_h + 10:
            cvs.move(img_id, 0, -10)
    elif 'Down' in keys:
        if y <= cvs_h - img_h - 10:
            cvs.move(img_id, 0, 10)

    root.update()
    root.after(20, gameLoop)

root.after(20, gameLoop)


gauge_length = 300
gauge_height = 30
gauge_value = 0

gauge = cvs.create_rectangle(50, 100, 50+gauge_length, 100+gauge_height, fill='lightgray')
cvs.create_text(200, 80, text='Press and hold Spacebar to fill the gauge', font=('Arial', 12))

is_space_pressed = False


def fillGauge():
    global gauge_value
    if is_space_pressed and gauge_value < gauge_length:
        gauge_value += 5
        cvs.coords(gauge, 50, 100, 50 + gauge_value, 100 + gauge_height)
        root.after(100, fillGauge)

    elif not is_space_pressed:
        cvs.coords(gauge, 50, 100, 50 + gauge_value, 100 + gauge_height)

def resetGauge():
    global gauge_value
    gauge_value = 0
    cvs.coords(gauge, 50, 100, 50 + gauge_value, 100 + gauge_height)

def keyPressHandler(event):
    global is_space_pressed
    if event.keysym == 'space':
        is_space_pressed = True
        fillGauge()
    elif event.keysym == 'Return':
        resetGauge()

def keyReleaseHandler(event):
    global is_space_pressed
    if event.keysym == 'space':
        is_space_pressed = False
        print(f'Final gauge value: {gauge_value}')

root.bind('<KeyRelease>', keyReleaseHandler)
root.bind("<KeyPress>", keyPressHandler)

tk_image2 = PhotoImage(file="������������.png").subsample(5,5)

img_target = cvs.create_image(400, 300, anchor=CENTER, image=tk_image2)

def mouseMoveHandler(event):
    cvs.coords(img_id, event.x, event.y)

root.bind('<Motion>', mouseMoveHandler)

obj_size = 30
tar_ball_size = 40

def collision():
    obj_x, obj_y = cvs.coords(img_id)
    tar_x, tar_y = cvs.coords(img_target)

    dx = obj_x - tar_x
    dy = obj_y - tar_y
    distance = (dx*dx + dy*dy)**0.5

    return distance < (obj_size/2 + tar_ball_size/2)

def mouseMoveHandler(event):
    cvs.coords(img_id, event.x, event.y)
    if collision():
        cvs.itemconfig(img_target, state=HIDDEN)


root.bind("<Motion>", mouseMoveHandler)




root.mainloop()

# data[].attributes.attachment_link.readable_text
from tkinter import *
import random
class App:
    def __init__(self,root):
        self.root=root
        self.label1=Label(root,text="��������� ���������������.")
        self.label1.pack()
        self.label2=Label(root,text="��������� 2������ ������������.")
        self.label2.pack()
        self.j_image = PhotoImage(file="������.png").subsample(2,2)
        self.q_image = PhotoImage(file="���.png").subsample(2,2)
        self.k_image = PhotoImage(file="���.png").subsample(3,3)
        self.CVS= Canvas(root, bg="white",highlightthickness=0)
        self.CVS.pack(fill=BOTH,expand=True)
        self.img_j = self.CVS.create_image(100,200,anchor=CENTER,image=self.j_image)
        self.img_q = self.CVS.create_image(400,200,anchor=CENTER,image=self.q_image)
        self.img_k = self.CVS.create_image(700,200,anchor=CENTER,image=self.k_image)
        






root=Tk()
root.title("������������")
app=App(root)
root.geometry("800x600")
root.mainloop()

# data[].attributes.body
물리1 교과 시간에 포물선 운동의 최고점과 도달거리를 구하는 과정에 호기심이 생겨, 속도를 수평, 수직 방향으로 나눌 때 삼각함수가 사용된다는 점에서 수학1과 연계하여 객체 지향 포물선 운동 계산 프로그램을 제작하였음. 수업 시간에 배운 이론을 바탕으로, 스스로 추가 자료를 찾아보고 프로그래밍을 통해 구현해서 자기주도적으로 학습을 할 수 있는 경험을 가짐.

# data[].attributes.body
import tkinter as tk

from PIL import Image, ImageTk

root = tk.Tk()

root.title("이미지 확대 예제")

# 원본 이미지 불러오기

original_image = Image.open("image.jpg")

# 이미지 확대 (예: 2배)

scale_factor = 2

new_width = int(original_image.width * scale_factor)

new_height = int(original_image.height * scale_factor)

resized_image = original_image.resize((new_width, new_height), Image.LANCZOS)

# tkinter용 이미지 객체로 변환

tk_image = ImageTk.PhotoImage(resized_image)

# 라벨에 이미지 표시

label = tk.Label(root, image=tk_image)

label.pack()

# 이미지 참조 유지

label.image = tk_image

root.mainloop()

# data[].attributes.body
야바위

# data[].attributes.attachment_link.readable_text
from tkinter import *
import random

root = Tk()
root.title("���������")
class App:
    def __init__(self,root,money):
        self.root=root
        self.money=money
        self.delmoney=0
        self.timing=1
        self.ch=1
        self.list=[1,2,3]
        self.win=0
        self.s=0

        self.label1=Label(root,text="��������� ���������������.")
        self.label1.grid(row=0,column=6,columnspan=6)
        self.label2=Label(root,text="��������� 2������ ������������.")
        self.label2.grid(row=1,column=6,columnspan=6)


        self.j_image = PhotoImage(file="������.png").subsample(2,2)
        self.q_image = PhotoImage(file="���.png").subsample(2,2)
        self.k_image = PhotoImage(file="���.png").subsample(2,2)
        self.b_image = PhotoImage(file="������.png").subsample(2,2)



        self.j_img=Label(root,image=self.j_image)
        self.j_img.grid(row=4,column=4,rowspan=3)

        self.q_img=Label(root,image=self.q_image)
        self.q_img.grid(row=4,column=8,rowspan=3)

        self.k_img=Label(root,image=self.k_image)
        self.k_img.grid(row=4,column=12,rowspan=3)

        
        self.label3=Label(root,text="������ ������ ��������� ������������.")
        self.label4=Label(root,text=f"������:{self.money}")
        self.label4.grid(row=0,column=12)
        

        self.e=Entry(root,width=25)
        self.e.grid(row=7,column=6,columnspan=6)

        self.btn1=Button(root,text="������",command=self.start)
        self.btn1.grid(row=9,column=6,columnspan=6)
    def start(self):
        try:
            self.label4['text']=f'������:{self.money}'
            self.label4.grid(row=0,column=12)
            if self.timing==1:
                self.delmoney=int(self.e.get())
                if self.money>=self.delmoney:
                    self.timing=0
                    self.money-=self.delmoney
                    self.label4.grid(row=0,column=12)
                    self.e.delete(0,END)
                    self.label4['text']=f'������:{self.money}'
                    self.root.after(10,self.bapu)
                    self.label4.grid(row=0,column=12)
        except:#��� ������������ ���������
            if self.money<self.delmoney:
                self.label3['text']='������ ������ ��������� ������������'
                self.label3.grid(row=10,column=6,columnspan=6)

            elif type(self.money)!=type(12):
                self.label3['text']='������ ������ ���������������'
                self.label3.grid(row=10,column=6,columnspan=6)
             

    def bapu(self):

 
        self.b_img_1=Button(root,image=self.b_image,command=self.choose_1)
        self.b_img_2=Button(root,image=self.b_image,command=self.choose_2)
        self.b_img_3=Button(root,image=self.b_image,command=self.choose_3)

        random.shuffle(self.list)

        self.j_img.destroy()
        self.j_img=Label(root,image=self.j_image)

        self.b_img_1.grid(row=4,column=4,rowspan=3)

        self.k_img.destroy()
        self.k_img=Label(root,image=self.k_image)

        self.b_img_2.grid(row=4,column=8,rowspan=3)

        self.q_img.destroy()
        self.q_img=Label(root,image=self.q_image)

        self.b_img_3.grid(row=4,column=12,rowspan=3)

    def choose_1(self):
        if self.ch==1:
            self.ch=0
            self.b_img_1.destroy()
            if self.list.index(1)==1:
                self.j_img.grid(row=4,column=4,rowspan=3)
                self.win=1
                self.s=1
            elif self.list.index(1)==2:
                self.k_img.grid(row=4,column=4,rowspan=3)
                self.win=0
                self.s=2
            
            else:
                self.q_img.grid(row=4,column=4,rowspan=3)
                self.win=0
                self.s=3
            self.b_img_2.destroy()
            self.b_img_3.destroy()
            self.b_img_1=Button(root,image=self.b_image,command=self.choose_1)
            self.b_img_2=Button(root,image=self.b_image,command=self.choose_2)
            self.b_img_3=Button(root,image=self.b_image,command=self.choose_3)
            self.root.after(1000, self.end)
    def choose_2(self):
        if self.ch==1:
            self.ch=0
            self.b_img_2.destroy()
            if self.list.index(2)==1:
                self.j_img.grid(row=4,column=8,rowspan=3)
                self.win=1
                self.s=1
               
            elif self.list.index(2)==2:
                self.k_img.grid(row=4,column=8,rowspan=3)
                self.win=0
                self.s=2
              
            else:
                self.q_img.grid(row=4,column=8,rowspan=3)
                self.win=0
                self.s=3
            self.b_img_1.destroy()
            self.b_img_3.destroy()
            self.b_img_1=Button(root,image=self.b_image,command=self.choose_1)
            self.b_img_2=Button(root,image=self.b_image,command=self.choose_2)
            self.b_img_3=Button(root,image=self.b_image,command=self.choose_3)
            self.root.after(1000, self.end)
    def choose_3(self):
        if self.ch==1:
            self.ch=0
            self.b_img_3.destroy()
            if self.list.index(3)==1:
                self.win=1
                self.s=1
                self.j_img.grid(row=4,column=12,rowspan=3)
            
            elif self.list.index(3)==2:
                self.win=0
                self.s=2
                self.k_img.grid(row=4,column=12,rowspan=3)
            
            else:
                self.win=0
                self.s=3
                self.q_img.grid(row=4,column=12,rowspan=3)
            self.timing=1
            self.b_img_1.destroy()
            self.b_img_2.destroy()
            self.b_img_1=Button(root,image=self.b_image,command=self.choose_1)
            self.b_img_2=Button(root,image=self.b_image,command=self.choose_2)
            self.b_img_3=Button(root,image=self.b_image,command=self.choose_3)
            self.root.after(1000, self.end)
    def end(self):
        if self.win==1:
            self.money+=self.delmoney*3
            self.label4['text']=f'������:{self.money}'
            self.label4.grid(row=0,column=12)
        if self.s==1:
            self.j_img.destroy()
            self.k_img=Label(root,image=self.k_image)
            self.q_img=Label(root,image=self.q_image)
            self.j_img=Label(root,image=self.j_image)
        elif self.s==2:
            self.k_img.destroy()
            self.j_img=Label(root,image=self.j_image)
            self.q_img=Label(root,image=self.q_image)
            self.k_img=Label(root,image=self.k_image)
        else:
            self.q_img.destroy()
            self.j_img=Label(root,image=self.j_image)
            self.k_img=Label(root,image=self.k_image)
            self.q_img=Label(root,image=self.q_image)
        self.j_img.grid(row=4,column=4,rowspan=3)
        self.k_img.grid(row=4,column=8,rowspan=3)
        self.q_img.grid(row=4,column=12,rowspan=3)
        self.ch=1
        self.timing=1







app=App(root,1000)
'''root.geometry("800x600")'''
root.mainloop()

# data[].attributes.body
수학1, 수학2시간에 배운 개념으로 o/x퀴즈를 만들었다

# data[].attributes.body
영화관 프로그램을 만들어보면서 가장 중요하게 생각했던 것은 화면에서 어떤 동장(클릭)을 하였을 때, 다른 화면이 생성되어 계속 연계되는 것을 하고 싶었다. 이 것을 영화관 프로그램에 녹여 포스터를 누르면 예매장이 뜨게 기타등등.

# data[].attributes.body
AI를 사용하지 않고 자신의 힘으로 코딩을 했음. 여러 부분에서 막혀서 어려움을 겪음. 하지만 그러한 어려움을 혼자서 해결하려 했으며 혼자서 해결하기 힘들었던 부분은 선생님께 그러한 상황에서 사용해야 할 함수 delete등을 물어보아서 해결함. 그러면서 자신만의 소프트웨어를 구현하게 됨.

# data[].attributes.body
이번 코딩프러그래밍을 하면서 연계했던 부분은 수학 2의 수행평가때 책을 읽었는데 그때 미분의 예시로 단속 카메라의 평균 변화율에 대해서 적혀있었습니다. 그래서 직접 코딩 프로그래밍을 하면서 이 그래프(속도 100이라 하면 +-3에서 그래프의 높낮이가 나오는 그래프 영상 참고)와 평균변화율의 관계에 대해서 직접 책에서 나온 예시를 해봐서 미분에 대한 이해와 파이썬 GUI의 활용하는데 스스로 성장함을 느겼습니다.

# data[].attributes.body
수학1 시간에 건강기능식품 보조제를 농도와 반감기를 이용하여 최적의 복용 시간을 구하는 수학적 모델과 식을 구현하였는데 이번 시간에 이를 프로그램으로 구현하고 사람들이 사용할 수 있는 형태의 GUI를 만들어냄.=수학과 연계했다. 코드를 짜는 과정에서 많은 실패를 겪었음에도 불구하고 끈기있게 도전하여 코드를 완전히 구현해냄.

# data[].attributes.body
강조하고 싶은 점:

-label, 버튼, 메시지박스 같은 GUI 기능 활용

-배우지 않은 함수 -직접 찾아보고 활용(자동저장)

-비밀번호와 메모장 두가지를 융합하여 활용

-비밀번호 입력 시 *로 표현된다는 점에서의 디테일

-나름 수작업을 많이 함

# data[].attributes.body
스스로 만들 수 있었던 것에 좋았고, 사실 class라는 것은 들어는 보았지만 사용한 적은 없었다. 옛날에 pygame을 한 번 만들어보던 시절에 예제를 찾아보는 중 class를 사용한 것을 보았지만 이제는 어느 정도 사용할 수 있게 된 것 같다. 파이썬은 배워도 배워도 모르는 부분이 계속 생겨나는 것이 재미있는 것 같다.

# data[].attributes.body
물리학 1에서 압력과 힘에 대한 내용을 가져와서 프로그래밍을 통해 계산하는 방법을 표현하였다 이로인해 물리학 문제를 풀다가 계산이 너무 어렵거나 복잡한게 있으면 이 프로그램을 쓰면 되고 이번 파이썬에서 배운 버튼이라든지 콤보 박스 라던지 이런 프로그래밍 언어를 사용해서 나타내는게 신기했고 파이썬에 이런 기능이 있다는걸 알게되서 너무 좋았다

# data[].attributes.body
반복문을 활용할려고 했고 카드를 뒤집게 할려고 노력했고 랜덤함수도 쓸려고 했고 여러 함수를 만들려고 노력을 했다

# data[].attributes.body
수학1 시간에서 삼각함수가 주파수와 관련있다는 것을 배우고 삼각함수의 계수가 사인파의 진폭, 주기가 주파수, x축 평행이동이 위상값과 관련있음을 잘 이해하여 gui로 잘 나타냄. Entry를 이용하여 진폭,주파수,위상을 입력받고 그 값에 따라 사인파가 변화하도록 프로그램을 잘 구상함.