The Slow Print
Introducing: Delayed Printing!
This isnt a very new thing... But some people may not know about it so here it is!
Delayed Printing is printing out a string slowly, one character at a time. Here is how you can do it!
The Simple Way
The Other way
Line by Line Breakdown
This line is different for the 2nd way of doing this. The 2nd way has one more thing, a default definition. The two arguments,
delay_time already have a default definition, so if you dont fill them in when calling the function, it will not error.
But in this simpler version , all this means is that when calling this function, you have to fill in two arguments, the text you want to be "slow printed", and the delay time between each character
for character in text:
This line is the same for both versions. This for loop will go through each character in the text that was entered into the function
These two lines is where the printing happens. I dont really know why printing does not work, but this gets the job done. The
sys.stdout.write part writes the variable and the
sys.stdout.flush() part makes the variable flush in the module(whatever that means..)
This line of code is where it waits a bit before printing out the next letter. In the function you will put in how long you want it to wait between each letter, or in the other version it's default is .05
Calling the Function
1) Simple way
2) The other way
Check out the below repl for the finished code
You can do A LOT with this function, for an example look here, i added a lot more things to the delprint() function in this file!
If you have any questions, comment them below! Im sure someone will answer it, either me or some random guy...
And also if you made a tutorial on this, I didn't copy it okay?
i redid the whole tutorial, i think its better.. And also a suggestion is to add this to the end of you function,
print(""). This will make it so that it indents after printing out the text. Your code should look like this, or of course with the "other way" it will be a bit different