MapleStory Finger Point

๐Ÿ’Ž Python/Python_Code

ํ”„๋กœ๊ทธ๋ž˜์Šค๋ฐ”๋กœ ๋ฉ€ํ‹ฐ ์Šค๋ ˆ๋“œ ํ‘œํ˜„ํ•˜๊ธฐ

HYEJU01 2024. 4. 7. 23:48

from tkinter import *
from tkinter.ttk import *
import random
import time
import threading

## 

class ThreadProgressBar() :
    thread = None
    progress = None

    def __init__(self,parent):
        self.progress = Progressbar(parent, orient=HORIZONTAL, length=400)
        self.progress.pack(side=TOP, fill=X,ipadx=10,padx=10,pady=10)
        self.thread = threading.Thread(target=self.runProgress,args=(self.progress,))
        self.thread.start()


    def runProgress(self, progress) :
        hop = 0
        while True :
            hop = random.randrange(0,10)
            if progress['value'] >= 100:
                break
            progress['value'] += hop
            time.sleep(0.5)


##
def runThreadProgress() :
    thBar1 = ThreadProgressBar(window)
    thBar2 = ThreadProgressBar(window)
    thBar3 = ThreadProgressBar(window)

##
if __name__ == "__main__" :
    window = Tk()
    window.geometry("300x250")
    window.title('๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ')
    threadButton = Button(window, text='๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ', command=runThreadProgress)
    threadButton.pack(side=TOP,fill=X, ipadx=10, ipady=10, padx=10, pady=10)

    window.mainloop()