728x90
๋ฐ˜์‘ํ˜•

1) ํŒŒ์ด์ฌ ์‹คํ–‰ ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ

 

1. ๋จผ์ € ์ฝ”๋“œ๋ฅผ gpt์— ์ž…๋ ฅํ•˜๋“ , ์ž์‹ ์ด ์ฐพ์•„๋ณด๋“ , ๋งŒ๋“ค๋“ ํ•ด์„œ ์ฝ”๋“œ๋ฅผ ์™„์„ฑํ•˜๊ณ  ์‹คํ–‰ ์‹œํ‚ต๋‹ˆ๋‹ค. (์ฝ”๋“œ ์‹คํ–‰๋˜์–ด์•ผ ๊ฐ€๋Šฅ)

import tkinter as tk
import datetime


class CountdownApp:
    def __init__(self, master):
        self.master = master
        self.master.title("์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌ ํ•„๊ธฐ ํ•ฉ๊ฒฉ ๊ฐ€๋ณด์ž๊ณ !")
        self.master.attributes("-fullscreen", True)
        self.end_date = datetime.datetime(2023, 5, 13)
        self.remaining_time_str = tk.StringVar(value=self.get_remaining_time())
        self.remaining_time_label = tk.Label(
            self.master,
            textvariable=self.remaining_time_str,
            font=("Arial", 96),
            fg="blue",
            bg="gray",
        )
        self.remaining_time_label.pack(pady=20)

        # Create image label
        self.image_label = tk.Label(self.master)
        self.image_label.pack(pady=10)

        self.message_label = tk.Label(
            self.master,
            text="์กฐ์ˆ˜ํ˜„ ์•„์ž์•„์ž ํ™”์ดํŒ…!",
            font=("Arial", 48),
            fg="white",
            bg="green",
        )
        self.message_label.pack(pady=10)

        # Load image and set it to the image label
        self.kakao_image = tk.PhotoImage(file="shsu.png")
        self.image_label.configure(image=self.kakao_image)

        self.countdown()


    def get_remaining_time(self):
        remaining = self.end_date - datetime.datetime.now()
        days, seconds = remaining.days, remaining.seconds
        hours = seconds // 3600
        minutes = (seconds % 3600) // 60
        seconds = seconds % 60
        remaining_time = f"{days:02}:{hours:02}:{minutes:02}:{seconds:02}"
        return remaining_time

    def countdown(self):
        self.remaining_time_str.set(self.get_remaining_time())
        if datetime.datetime.now() >= self.end_date:
            self.remaining_time_str.set("Time's up!")
            return
        self.master.after(1000, self.countdown)


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

๊ฒฐ๊ณผ๋Š” ์ด๋ ‡๊ฒŒ ๋‚˜์˜ค๊ตฌ์—ฌ~~ ์ด๊ฑธ ํŒŒ์ผ๋กœ ๋งŒ๋“ค์–ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค!! (์ •์ฒ˜๊ธฐ ์ค€๋น„ํ•˜์‹œ๋Š”๋ถ„๋“ค ํŒŒ์ด๋ง)

 

2. ํ„ฐ๋ฏธ๋„์—  pip install pyinstaller์„ ์ž…๋ ฅํ•ด์ค๋‹ˆ๋‹ค

 

3. ๊ทธ ํ›„์— pyinstaller -w ํŒŒ์ผ๋ช…(countdown_gosim.py)์„ ํ„ฐ๋ฏธ๋„์— ์ž…๋ ฅํ•ด์ค๋‹ˆ๋‹ค

 

4. ๋งˆ์ง€๋ง‰์œผ๋กœ dist ์•ˆ์— ์žˆ๋Š” ์ฑ… ๋ชจ์–‘ ์‹คํ–‰ ํŒŒ์ผ์„ ์ฐพ์•„์„œ ์—ด์–ด์ฃผ๋ฉด ํŒŒ์ด์ฌ์ด ์—†์–ด๋„ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์‹คํ–‰ ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ ๋!!!

 

 

2)  chat gpt๋ฅผ vscode ์•ˆ์œผ๋กœ ๋ฐ๋ฆฌ๊ณ  ์˜ค๊ธฐ๐Ÿ‘

 

(421) ChatGPT๋ฅผ VSCode์•ˆ์œผ๋กœ ๋ฐ๋ฆฌ๊ณ  ์˜ค์ž | ์ธ๊ณต์ง€๋Šฅ ์ฝ”๋”ฉ - YouTube

์ด ์˜์ƒ์„ ์ฐธ๊ณ ํ•˜์˜€์Šต๋‹ˆ๋‹ค ใ…Žใ…Žใ…Ž ๋˜‘๋˜‘ํ•œ gpt์”Œ๐Ÿ˜

 https://platform.openai.com/account/api-keys

 

OpenAI API

An API for accessing new AI models developed by OpenAI

platform.openai.com

1. ์š” ๋งํฌ ๋“ค์–ด๊ฐ€์…”์„œ ํ‚ค๋ฅผ ๋งŒ๋“ค๊ณ  ๋ณต์‚ฌ๋ฅผ ํ•œํ›„์—

2. ์„ค์ •(Setting) ๋“ค์–ด๊ฐ€์…”์„œ Goto Location: Alternative Definition Command ๋ฐ‘์— ๋ณต์‚ฌํ•œ ํ‚ค๋ฅผ ๋ณต์‚ฌ๋ถ™์—ฌ๋„ฃ๊ธฐ ํ•˜๋ฉด ๋!!3.

 

++chat gpt๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๋ฐฉ๋ฒ•์€ ์ด๋Ÿฌ์ด๋Ÿฌํ•ฉ๋‹ˆ๋‹น

728x90
๋ฐ˜์‘ํ˜•
728x90
๋ฐ˜์‘ํ˜•

2์ง„๋ฒ• : ์ปดํ“จํ„ฐ๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹(0๊ณผ1๋งŒ ์กด์žฌ)

10์ง„๋ฒ• : ์šฐ๋ฆฌ๊ฐ€ ํ‰์†Œ์— ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹

16์ง„๋ฒ• : ์ปดํ“จํ„ฐ ๋ถ„์•ผ์—์„œ ์ˆซ์ž๋ฅผ ํ‘œํ˜„ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ์ง„๋ฒ• ํ˜•์‹, ์ž๋ฆฟ์ˆ˜ ํ•˜๋‚˜๊ฐ€ 0~15๊นŒ์ง€ ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค. ํ•˜์ง€๋งŒ ์šฐ๋ฆฌ๊ฐ€ ํ”ํžˆ ์‚ฌ์šฉํ•˜๋Š” ์•„๋ผ๋น„์•„ ์ˆซ์ž๋Š” 0๋ถ€ํ„ฐ 9๊นŒ์ง€ ๋ฐ–์— ์—†๊ธฐ ๋•Œ๋ฌธ์— ๋‚˜๋จธ์ง€ 10์€ A, 11์€ B, 12๋Š” C, 13์€ D, 14๋Š” E, 15๋Š” F๋กœ ๋กœ๋งˆ์ž๋ฅผ ์‚ฌ์šฉํ•ด ํ‘œํ˜„ํ•œ๋‹ค.

 

<73์„ 2,10,16์ง„๋ฒ•์œผ๋กœ ๋‚˜ํƒ€๋‚ด๊ธฐ >

๋”๋ณด๊ธฐ

 2์ง„๋ฒ• : 1001001(2) 

10์ง„๋ฒ• : 73

16์ง„๋ฒ• : 100/1001 ๋’ค์—์„œ๋ถ€ํ„ฐ 4๊ฐœ์”ฉ ๋Š์–ด์„œ ํ•ฉ์ด 10์ด ๋„˜์œผ๋ฉด 10์€ A, 11์€ B, 12๋Š” C, 13์€ D, 14๋Š” E, 15๋Š” F๋กœ ๋กœ๋งˆ์ž๋ฅผ ์‚ฌ์šฉํ•˜๋ฏ€๋กœ, 100 = 4, 1001=9๋กœ 49์ด๋‹ค

<Teachable Machine ์‚ฌ์šฉํ•˜๊ธฐ>

1. ์บ ์œผ๋กœ ์‚ฌ์ง„์ฐ์–ด ๊ฐ–๊ฐ€์ง€ ์ƒ˜ํ”Œ ๋งŒ๋“ค๊ธฐ(๊ฐ€์œ„๋ฐ”์œ„๋ณด/ Class1: ๋ฐ”์œ„, Class3 : ๋ฌต, Class4:  ๊ฐ€์œ„)

2. ๋ชจ๋ธ ํ•™์Šต ์™„๋ฃŒํ•˜๊ธฐ

3. ํ•™์Šต์„ ์™„๋ฃŒํ•˜๋ฉด ์ด๋Ÿฐ ํ™”๋ฉด์ด ๋‚˜ํƒ€๋‚˜๊ณ  ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๋‚ด๋ณด๋‚ด๊ธฐ ๊ธฐ๋Šฅ๋„ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค!!

4. ํ™”๋ฉด๊ณผ ์ €์žฅ๋œ ์ƒ˜ํ”Œ์„ ๋น„๊ตํ•ด์„œ ํผ์„ผํŠธ๊ฐ€ ๋‚˜์˜ต๋‹ˆ๋‹ค. ์•„๋ฌด๊ฒƒ๋„ ์•ˆํ•˜๊ณ  ์žˆ๋Š”๋ฐ ํผ์„ผํŠธ๊ฐ€ ์˜ฌ๋ผ๊ฐ€๋Š”..

Chat GPT์™€ ์œ ์‚ฌํ•˜๊ฒŒ ๋งˆ์ดํฌ๋กœ์†Œํ”„ํŠธ์‚ฌ์—์„œ ๋‚˜์˜จ Bing๋„ ๊ฒ€์ƒ‰ ์—”์ง„๋„ ์‹คํ–‰ ํ•ด๋ณด์•˜์Šต๋‹ˆ๋‹ค

Q. "ํŒŒ์ด์ฌ์œผ๋กœ ๋‹ค์ด์•„๋ชฌ๋“œ ๋งŒ๋“œ๋Š” ํ”„๋กœ๊ทธ๋žจ ์งœ์ค˜"๋ฅผ ๋ฌผ์–ด๋ณธ ๊ฒฐ๊ณผ?

์•ˆ๋…•ํ•˜์„ธ์š”. ์ด๊ฒƒ์€ bing์ž…๋‹ˆ๋‹ค. ํŒŒ์ด์ฌ์œผ๋กœ ๋‹ค์ด์•„๋ชฌ๋“œ ๋ชจ์–‘์„ ๋งŒ๋“œ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์งœ๊ณ  ์‹ถ์œผ์‹ ๊ฐ€์š”? ๊ทธ๋ ‡๋‹ค๋ฉด ์›น ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ ์ฐธ๊ณ ํ•˜์‹œ๋ฉด ๋„์›€์ด ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด 1์—์„œ๋Š” for ๋ฐ˜๋ณต๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋‹ค์ด์•„๋ชฌ๋“œ ๋ชจ์–‘์„ ๋งŒ๋“œ๋Š” ๊ฐ„๋‹จํ•œ ์ฝ”๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

h = eval(input("Enter diamond's height: "))
for x in range(h):
    print(" " * (h - x), "*" * (2*x + 1))

๋‹ค๋ฅธ ๋ฐฉ๋ฒ•๋“ค๋„ ์žˆ์œผ๋‹ˆ 234 ๋“ฑ์„ ์‚ดํŽด๋ณด์„ธ์š”. ํŒŒ์ด์ฌ์— ๋Œ€ํ•ด ๋” ๋ฐฐ์šฐ๊ณ  ์‹ถ์œผ์‹œ๋‹ค๋ฉด 5์—์„œ ํŒŒ์ด์ฌ ๊ธฐ์ดˆ ๋ฌธ๋ฒ•๊ณผ ํ”„๋กœ๊ทธ๋žจ ์ œ์ž‘ ๊ณผ์ •์— ๋Œ€ํ•ด ์„ค๋ช…ํ•˜๋Š” ๊ธ€์„ ์ฝ์–ด๋ณด์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

๋ฌผ์–ด๋ณด๋ฉด ๋กœ๋”ฉํ•˜๋Š” ์‹œ๊ฐ„์ด ์ข€ ๊ฑธ๋ ค์„œ ๊ท€์ฐฎ์•˜์ง€๋งŒ gpt๊ฐ€ ์˜ค๋ฅ˜๋„ ์žˆ๊ณ  2021๋…„ ์ดํ›„์˜ ๋‚ด์šฉ์€ ์ œ๊ณต ์•ˆํ•ด์„œ ๋ณ‘ํ–‰ํ•ด์„œ ์‚ฌ์šฉํ•˜๋ฉด ์ข‹์„๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!!

 

๋งˆ์ง€๋ง‰์œผ๋กœ ์˜ค๋Š˜ ์ฝ”๋”ฉํ•œ ๊ฑฐ..(ํŒŒ์ด์ฌ์œผ๋กœ ํ•จ์ˆ˜ ๋งŒ๋“ค๊ธฐ)

def func1():
    print('aaa')

def func2(data1, data2):
    print("{0}+{1}".format(data1,data2))

def func3(data1, data2):
    return data1*data2

#func2(1,2)
data3 = func3(2,3)
print(data3)
๋”๋ณด๊ธฐ

์ด ์ฝ”๋“œ๋Š” ์„ธ ๊ฐœ์˜ ํ•จ์ˆ˜ 'func1()', 'func2(data1, data2)', 'func3(data1, data2)'๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค

 'func1()' ์€ ์ธ์ž๋ฅผ ๋ฐ›์ง€ ์•Š์œผ๋ฉฐ, ๋‹จ์ˆœํžˆ 'aaa' ๋ฌธ์ž์—ด์„ ์ฝ˜์†”์— ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค

'func2(data1, data2)'์€ ๋‘๊ฐœ์˜ ์ธ์ž๋ฅผ ๋ฐ›๊ณ , ์ด๋ฅผ ๋ฌธ์ž์—ด ํฌ๋ฉงํŒ…์„ ์ด์šฉํ•ด ๋”ํ•œ ๊ฒฐ๊ณผ๋ฅผ ์ฝ˜์†”์— ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

'func3(data1, data2)'์€ ๋‘๊ฐœ์˜ ์ธ์ž๋ฅผ ๋ฐ›๊ณ  ์ด๋ฅผ ๊ณฑํ•œ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค

๋งˆ์ง€๋ง‰ ์ค„์—์„œ๋Š” 'func3()' ํ•จ์ˆ˜๋ฅผ ์ธ์ž 2์™€ 3์œผ๋กœ ํ˜ธ์ถœํ•˜์—ฌ ๋ฐ˜ํ™˜๋œ ๊ฐ’์„ 'data3' ๋ณ€์ˆ˜์— ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค. ๊ทธํ›„ 'data3'์˜ ๊ฐ’์„ ์ฝ˜์†”์— ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ถœ๋ ฅ๋˜๋Š” ๊ฐ’์€ 6์ด ๋ฉ๋‹ˆ๋‹ค.

'func2(1,2)'๋ผ๋Š” ์ฝ”๋“œ๋Š” ์ฃผ์„ ์ฒ˜๋ฆฌ๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ ์‹คํ–‰๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค ์ด ์ฝ”๋“œ์˜ ์ฃผ์„์„ ํ•ด์ œํ•˜๋ฉด, 1๊ณผ 2๋ฅผ ์ธ์ž๋กœ ํ•˜์—ฌ ํ•จ์ˆ˜๊ฐ€ ํ˜ธ์ถœ๋˜์–ด ์ฝ˜์†”์•  3์ด ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค!!

 

728x90
๋ฐ˜์‘ํ˜•

+ Recent posts