r/stackoverflow • u/Nubian_Cavalry • Sep 02 '24
Python Bulk apply time.sleep(seconds)? In Python?
I’m writing a long questionnaire program for my resume, is there a way for me to make it so every single print statement/input in my main module as well as my functions will be preceded and followed by time.sleep(seconds) with a singular function or a few lines of code, rather than having to manually enter it between each line?
1
Upvotes
View all comments
Show parent comment
1
u/ennezetaqu Sep 02 '24
It's actually easier than it seems. The steps are:
Hint: use a for loop. Hint 2: if you put your functions in another file, remember to import the file and to properly call the functions in the exec command.
Of course, you can keep calling the functions individually and repeat the use of time.sleep() (and that's what almost anyone would do I guess).