About 67,500 results
Open links in new tab
  1. Is there a way to clear Python's IDLE window? - Stack Overflow

    Sep 16, 2009 · Run -> Python Shell. The problem with this method is that it will clear all the things you defined, such as variables. Alternatively, you should just use command prompt. open up command prompt. type "cd c:\python27" type "python example.py" , you have to edit this using IDLE when it's not in interactive mode. If you're in python shell, file ...

  2. Clear the terminal in Python - Stack Overflow

    Every time you type clear() on the shell (command line), it will clear the screen in your shell. If you exit the shell, then you must redo the above to do it again as you open a new Python (command line) shell. Note: It does not matter what version of Python you …

  3. python - Clear screen in shell - Stack Overflow

    I'm running Mac OS X 10.7.5 and iTerm 2 for my terminal. Using Python2.7, the stdscr = curses.initscr() works to clear the screen, and the stdscr.clear() does nothing. Using Python3.4, the stdscr = curses.initscr() does clear the screen, but takes away the terminal's

  4. python - How can I clear the interpreter console? - Stack Overflow

    If x is 2, it will clear entire screen and move cursor to upper left. If x is 3, it will clear entire screen and delete all lines saved in the scrollback buffer. So, this command will clear everything, including buffer: print("\033[H\033[3J", end="") COMMAND LINE: To clear screen in a shell (console / terminal) you can use the same command.

  5. How to clear the screen in Python - Stack Overflow

    Jan 27, 2011 · There is now a simple class: pip3 install clear-screen and then to use it: from clear-screen import clear and then the method clear() will clear your shell – user10364045 Commented Jan 27, 2019 at 23:04

  6. shell - Python - Clearing the terminal screen more elegantly

    Dec 21, 2015 · You could also cache the clear-screen escape sequence produced by clear command: import subprocess clear_screen_seq = subprocess.check_output('clear') then. print clear_screen_seq any time you want to clear the screen. tput clear command that produces the same sequence is defined in POSIX. You could use curses, to get the sequence:

  7. python - Clearing the screen in IPython - Stack Overflow

    Jul 31, 2011 · The command clear-screen does not seem to work on my system (Windows with Spyderlib), but I like the idea of binding a solution to C-l – Amelio Vazquez-Reina Commented Jul 31, 2011 at 21:08

  8. How to clear Python Shell in IDLE - Stack Overflow

    By python shell, do you mean IDLE? Some quick googling suggests that IDLE doesn't have a clear screen even though lots of people seem to want one. If it's in a shell, then I'm surprised 'cls' isn't working.

  9. python - How to clear the screen of ALL text in IDLE shell? - Stack ...

    Jun 29, 2019 · The screen MUST be clear, I don't want to print a million new lines. Here is my code: import sys valone = 5 valtwo = 5 # create line of text sys.stdout.write(" a " * valone + " t " + " a " * valtwo) # move t character 1 space valone = valone -1 valtwo = valtwo + 1 # clear screen and redraw line with t moved 1 space.

  10. How to clear screen on python 3.6 IDLE? - Stack Overflow

    Apr 1, 2017 · The "cls" and "clear" are commands which will clear a terminal (ie a DOS prompt, or terminal window). From your screenshot, you are using the shell within IDLE, which won't be affected by such things. Unfortunately, I don't think there is a way to clear the screen in IDLE. The best you could do is to scroll the screen down lots of lines, eg: