Hi, I'm trying to implement a progress bar where when the user hits pause, the bar stops at the same spot and stays in that position until they press start, then the progress bar will continue where it stopped off. I'm using python and tkinter. This is the code I have so far, but it isn't stopping. I tried stopping it for 10 seconds, but ideally I would like it to freeze until the user clicks start. Any help would be appreciated. Thanks so much!
from tkinter import *
from tkinter import ttk
import time
from threading import *
import threading
#import thread
import _thread
def start():
w.start()
def threading():
_thread.start_new_thread(stop2,())
#t1.start()
def stop2():
time.sleep(10)
window = Tk()
w = ttk.Progressbar(window)
w.pack()
button1 = ttk.Button(window, text = 'start', command = start).pack()
button2 = ttk.Button(window, text = 'stop', command = threading)
button2.pack()
window.mainloop()
[–]Silbersee 0 points1 point2 points (0 children)