Monday, May 12, 2014

clearing command line


After you have installed the Interpreter now lets start with basic mathematical operations.

Introduction:  After opening the python command line, you will see the command prompt.
If you are using windows, type the following command to clear the screen

import os
os.system("cls")

if you are using linux or mac then the following may work

import os
os.system("clear")

the above code will clear your screen and there will be only a command prompt.
however clearing the window is just not mandatory. It depends on user wether he wants to clear the screen or not.





No comments:

Post a Comment