How to clear the interpreter console?

后端 未结 30 2267
自闭症患者
自闭症患者 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:36

    I might be late to the part but here is a very easy way to do it

    Type:

    def cls():
        os.system("cls")
    

    So what ever you want to clear the screen just type in your code

    cls()
    

    Best way possible! (Credit : https://www.youtube.com/watch?annotation_id=annotation_3770292585&feature=iv&src_vid=bguKhMnvmb8&v=LtGEp9c6Z-U)

提交回复
热议问题