📜  如何清除命令行python代码示例

📅  最后修改于: 2022-03-11 14:45:59.123000             🧑  作者: Mango

代码示例1
import os

def clearConsole():
    command = 'clear'
    if os.name in ('nt', 'dos'):  # If Machine is running on Windows, use cls
        command = 'cls'
    os.system(command)

clearConsole()