📜  如何清除控制台python代码示例

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

代码示例6
def clear(): 
  
    # for windows 
    if name == 'nt': 
        _ = system('cls') 
  
    # for mac and linux(here, os.name is 'posix') 
    else: 
        _ = system('clear')