检查此模块 键盘是否 具有许多功能。安装它,也许使用以下命令:
pip3 install keyboard
然后在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)现在,将文件从python文件夹粘贴到 Lib中 。
现在,您可以像以下示例一样使用它:
import textdottextdot.text('Loading',6,3)谢谢



