How to clear the interpreter console?

后端 未结 30 2268
自闭症患者
自闭症患者 2020-11-21 18:15

Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir() stuff, help() stuff

30条回答
  •  猫巷女王i
    2020-11-21 18:38

    You have number of ways doing it on Windows:

    1. Using Keyboard shortcut:

    Press CTRL + L
    

    2. Using system invoke method:

    import os
    cls = lambda: os.system('cls')
    cls()
    

    3. Using new line print 100 times:

    cls = lambda: print('\n'*100)
    cls()
    

提交回复
热议问题