Making Text look like it's being typed in the Python Shell
Question: So far the only method I've come up with is clearing the console then
displaying the string with one more letter. Suggestions?

Current Code:

    
    
    import os
    import time
    In=list(input("Text to be displayed: "))
    Out=""
    Move=[]
    print("-")
    while len(Move)<len(In):
        Move+=["/","|","\\","-"]
    for a in range(0,len(In)):
        if In[a]==" ":
          x=.3
        elif In[a] in ",';:!@#$%^&*()_+-=[]{}":
          x=.25
        elif In[a] in "aeiouzxcvbnm1234567890AEIOUZXCVBNM":
          x=.2
        else:
          x=.15
        os.system('cls')
        Out+=In[a]
        print(Out+Move[a])
        time.sleep(x)
    os.system('cls')
    print(Out)
    input()
    


Answer: Just use `print()` with `end=''` to stay on the same line, and `flush = True`
for the timing:

    
    
    import time
    Move+=["/","|","\\","-"]
    text = input('Text to be displayed: ')
    for i in text:
        print(i, end='', flush=True)
        time.sleep(0.1)
    print('\n')
    

This runs as:

    
    
    bash-3.2$ python3.3 test.py
    Text to be displayed: This is a test
    This is a test
    
    bash-3.2$ 
    

## Addressing your comment, use the below code:

    
    
    import time
    Move=["/","|","\\","-",""]
    text = input('Text to be displayed: ')
    for i in range(len(text)):
        print(text[i]+Move[i%5], end='', flush=True)
        time.sleep(0.1)
    print('\n')
    

