+ 3
Typewriter effect on inputs (python)
So I learned how to get python to print strings horizontally over a certain period of time instead of putting out the entire string at once. Like the interface is typing: import sys,time,os message = ("hello world!) for char in message: sys.stdout.write (char) sys.stdout.flush() time.sleep (0.1) What I'm trying to figure out it how to get it to respond to input by using the same method but when I do: import sys,time,os message = input ("hello world!) for char in message: sys.stdout.write (char) sys.stdout.flush() time.sleep (0.1) It just prints everything out at once again. Anyone know how to fix? Thanks!
11 Réponses
0
Works if I don't put input. Something about that input is messing it up...
0
Hey! I have the same problem. It looks like when I run it through the text of an input, it wants to return “None” before the user can enter an input.
Did you find a solution to this?
0
Mirielle[Inactive] nice! After I posted this I came to another solution: use whatever you need to for the typewriter effect, then set the input as simply “ “. So the typewriter effect only affects a string, and the imput is just a space occurring between the sentence and the actual input.
0
Sorry bout that lol