トップ 差分 一覧 ソース 検索 ヘルプ RSS ログイン

PRG-PY_console

コンソールがうるさい

Python から clear コマンドを実行すると"clear"がないと怒られた(Windowsには無いよね)

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

if __name__ == '__main__':
   clearConsole()