0
Sans text
Is there a way to have a string print itself out over the console? Example would be like like in undertale, when sans has a message to say it prints itself out instead of all of the text appearing in one instance.
6 odpowiedzi
+ 2
I will give you the code, but this will work just on your computer, in the python ide or in windows cmd:
import time
from os import system
sentence = "Hello here is a sentence I am long to see my effect"
for i in sentence:
print(i, end="", sep="", flush=True)
time.sleep(0.05)
### copy the code just till here if you are working in python IDE###
print("\n")
a = system('cls')
for l in range(10):
print(sentence)
time.sleep(0.5)
system('cls')
time.sleep(0.5)
print(sentence)
time.sleep(10)
### copy the whole code if you are working in the command line to see the flickering effect of the text
### notice that this code will not work on solo learn
I hope I could help you out
+ 1
William M This is exactly what i needed, thank you! I used repl.it to run the code and it works just fine
+ 1
You are welcome any time
0
I don't get you. Can you clarify it without the undertale example cuz I do not know the game undertale
0
William M Sorry, what Im having an issue with is when ill do something like “print(‘random sentence’)” And then run the program, the text appears all at once. What i want to happen is each letter appear after another, making it look like the text is being typed out across the screen
0
And tell me about the results