How to clear the interpreter console?

后端 未结 30 2185
自闭症患者
自闭症患者 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条回答
  •  甜味超标
    2020-11-21 18:22

    This is the simplest thing you can do and it doesn't require any additional libraries. It will clear the screen and return >>> to the top left corner.

    print("\033[H\033[J")
    

提交回复
热议问题