How to clear the interpreter console?

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

    here something handy that is a little more cross-platform

    import os
    
    def cls():
        os.system('cls' if os.name=='nt' else 'clear')
    
    # now, to clear the screen
    cls()
    

提交回复
热议问题