Skip to content
← Back to Community
Print a sentence letter by letter and create a real-time timer in python
Profile icon
mkhoi

Print the sentence letter by letter and create a real-time timer in python, help me.

:)

Voters
Profile icon
mkhoi
Comments
hotnewtop
Profile icon
argthe1st

Look into the python time module, you can use either time.time() and compare start times and end times or use time.sleep(duration)

Profile icon
mkhoi

@argthe1st im not sure, i want to create a timer that will countdown and then the user will have to do inputs while the timer is working

Profile icon
mwilki7

@mkhoi you will be interested in multi-threading, then

Profile icon
argthe1st

@mkhoi I'm not really sure how you would go about doing that if you are doing it in the terminal, as when you get an input, you have to wait for the user, therefore, making you unable to display the time as seen here (https://repl.it/@argthe1st/SuburbanFrenchPoint, also something weird happens when you hold enter down). But if you are doing it in/with some sort of game library like pygame, then you would just have to do what I did in the program above