Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Pythonwin のようなものを使用するときは、常にデバッグ ウィンドウですべてを強調表示し、delete を押してすべてを削除する必要があります。プログラムがデバッグ ウィンドウを自動クリアする方法はありますか?
Pythonwin で機能する関数を次に示します。
import subprocess def cls(): doc=subprocess.sys.stdout.GetDocument() Editor=doc.GetEditorView() Editor.SetSel(-1,0) Editor.ReplaceSel("") cls()
試す:
import os os.system("cls")