I have a section of code which looks like this:
for l in blah:
sys.stdout.write(l)
sys.stdout.flush()
time.sleep(0.025)
which adds a slight delay between each character being printed in a print statement, which is assigned to the variable blah
. However, if there is a variable present in the print statement, so for instance:
blah = "\n", player_name, ", you must save this land from the virus that has blighted us.\n"
then the print statement will not print as I wanted it to, but rather as a normal print statement would.
I expected the print statement to be printed as if it were being typed quickly, line by line, but instead, the print statement was printed all at once.