第一種方法,在指令行視窗輸入: import os i=os.system("cls") 第二種方法,在指令行視窗輸入: import subprocess i=subprocess.call("cls", shell=True)