现在的位置: 首页 > 综合 > 正文

how to clear screen in python

2012年10月23日 ⁄ 综合 ⁄ 共 277字 ⁄ 字号 评论关闭

If you mean the screen where you have that interpreter prompt >>>
,

you can do CNTL-L on Bash shell can help.

Windows does not have equivalent. You can do


import os
os.system('cls') #on windows

or

os.system('clear') # on linux / os x


reference:

http://stackoverflow.com/questions/4810537/how-to-clear-the-screen-in-python

抱歉!评论已关闭.