The question is about this project: https://repl.it/@LerconnDesign/First-Project
I wanted to write a code to print something slowly and not instantly. Basically it prints some part of the actual thing that is going to be printed and adds one letter every few milliseconds so the output would look like this if we have "welcome" as our actual word to print:
W
We
Wel
Welc
Welco
Welcom
Welcome
I found the solution to that (I'll show the code) but I have another question from this.
So I used this code (in a new file not in the "main"):
from time import sleep
speed=input("Time Passes Between Characters (Please enter a real NUMBER):")
speed=float(speed)
state="NoError"
def print1(text, sleepy=speed):
allprint=""
for a in text:
allprint+=a
print(allprint, end="\r")
sleep(sleepy)
Imported that into the main file and used it when needed. For example:
print1("Hello Lerconn User!\n")
It worked for a while. But then... Some of the texts I used this on started to copy themselves.
So the first part of the code that started doing this is like below:
print1("You have chosen the wait-times as below: \n between each character: " + str(speed) + " \n between each sentence: " + str(speed2))
So it should have probably printed this if speed and speed2 were both 1:
*You have chosen the wait-times as below:
between each character: 1
between each sentence: 1*
However, it did something more like this:
You have chosen the wait-times as below:
You have chosen the wait-times as below:
You have chosen the wait-times as below:
You have chosen the wait-times as below:
You have chosen the wait-times as below:
And keeps on copying. (It literally covers the entire screen so I only pasted a small part of the output (Nothing valuable in the remaining part , only the same copied so much times.)
If you want any other detail about the code, I will help you as much as I can.
If you didn't find this explanation enough, you can go to the link I gave at the beginning.