How to Clear Console in Python — pythonpip.com

Python clear console

Linux system

import os def clear_console(): os.system('clear') clear_console()

Windows system

import os def clear_console(): os.system('cls') clear_console()

Lambda Function To Clear Console in Python

import os def clear_console(): return os.system('clear') clear_console()

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Parvez Alam

Parvez Alam

Hey, I am Parvez Alam. A software developer since 2009. I love learning and sharing knowledge. https://www.phpflow.com/