第一种方法,在命令行窗口输入: import os i=os.system("cls") 第二种方法,在命令行窗口输入: import subprocess i=subprocess.call("cls", shell=True)