利用 subprocess 模块

For OS X, you can use subprocess module and call 'cls' from shell:

To prevent '0' from showing on top of the window, replace the 2nd line with:

For linux, you must replace cls command with clear

利用 os 模块

推荐利用快捷键

ctrl + L

Clear screen in shell 清空 shell 的输出-新乡seo|网站优化,网站建设_微信公众号:zeropython—昊天博客