Ah, excellent. threading is a great thing to show people.... Im still stuck for another idea for a tutorial though.. Unless i do wxPython ones. I already have some of those at my site tho :P
Paul Thompson
Veteran Poster
1,119 posts since May 2008
Reputation Points: 264
Solved Threads: 183
Skill Endorsements: 1
Here is little modified version to be more evident what it does:
## run with Python 3 from command line or double click
import threading
import time
def TimeProcess():
while not threadBreak:
print (time.time() - startTime)
input("""
Press enter key to start timer,
after some time push enter again to stop it!""")
threadBreak = False
startTime = time.time()
threading.Thread(target = TimeProcess).start()
input()
threadBreak = True
input ('Quit by enter')
quit()
pyTony
pyMod
6,299 posts since Apr 2010
Reputation Points: 879
Solved Threads: 984
Skill Endorsements: 26
woooee
Posting Maven
2,703 posts since Dec 2006
Reputation Points: 827
Solved Threads: 777
Skill Endorsements: 9