I want to print Text \'Loading...\' But its dots would be moving back and forward (in shell).
I am creating a text game and for that it will look b
Check This Module Keyboard with many features. Install It, perhaps with this command:
pip3 install keyboard
Then Write the following code in File textdot.py:
def text(text_to_print,num_of_dots,num_of_loops):
from time import sleep
import keyboard
import sys
shell = sys.stdout.shell
shell.write(text_to_print,'stdout')
dotes = int(num_of_dots) * '.'
for last in range(0,num_of_loops):
for dot in dotes:
keyboard.write('.')
sleep(0.1)
for dot in dotes:
keyboard.write('\x08')
sleep(0.1)
Now Paste the file in Lib from your python folder.
Now you Can use it like following example:
import textdot
textdot.text('Loading',6,3)
Thanks