Python Forum
clearing an interactive python interpreter/shell
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
clearing an interactive python interpreter/shell
#1
I got really sick of always doing this when I want to clear my shell:

from os import system
system('clear')
Or with the subprocess module etc...

So I made the simplest module ever on Pypi: pip3 install clear-screen

from clear_screen import clear
clear()
The import statement isn't much better than the os module import... but I like being able to quickly type clear() when I want to. Maybe there is already a module to do this? If not then there is now! clear-screen
Reply
#2
On Linux: CTRL + L
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#3
(Jan-28-2019, 04:58 AM)DeaD_EyE Wrote: On Linux: CTRL + L

On MacOS CMD + K
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#4
In cmder with interactive shell ptpython(my favorite) or IPython.
Then do CTRL + L work.

IDLE and cmd is just bad compare to what i posted over in Windows.
I use command line a lot,so using cmd/powershell is just terrible compared to cmder(16k stars on GitHub).
cmder is as good as any Terminal/shell that i use on Linux(i like to use fish shell on Linux).
Reply
#5
I don’t like keyboard shortcuts as much because I have to remove my hands from the qwerty position hahaha
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  filtering python code the interpreter reads Skaperen 0 1,145 Feb-02-2022, 08:29 PM
Last Post: Skaperen
  clearing a hashlib object Skaperen 0 1,741 Nov-28-2021, 07:54 PM
Last Post: Skaperen
  Which is best python package to create interactive page? Py_veeran 2 1,915 Aug-14-2020, 04:00 AM
Last Post: ndc85430
  Interactive online python learning environment freely available kenttong 0 1,527 Jan-29-2020, 03:49 AM
Last Post: kenttong
  Why does pycharm return nothing when Python interpreter does? Jessy 3 4,688 Nov-13-2019, 03:27 PM
Last Post: ndc85430
  Python Shell As Preferred Mode For Integrated Terminal In Visual Studio Code adt 4 3,976 Sep-07-2019, 06:00 PM
Last Post: adt
  Notepad vs anaconda spyder or python shell ShadowAlpha 2 2,913 Jun-26-2019, 06:31 AM
Last Post: perfringo
  Notepad++ with Python interpreter Truman 14 11,022 Feb-27-2019, 11:54 PM
Last Post: Truman
  embedding Python script in shell scripts Skaperen 5 8,151 Mar-23-2018, 01:07 AM
Last Post: Skaperen
  Python interactive/live programming framework, is it useful for you? sjdv1982 0 2,545 Oct-15-2017, 01:55 PM
Last Post: sjdv1982

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020