Python Forum
how to clear the console when the programm is running (not manually)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to clear the console when the programm is running (not manually)
#6
This will position the cursor at the botom of the terminal window. 
Better use suprocess module
import subprocess

try:
    subprocess.call(['cls']) # Windows call
except FileNotFoundError:
    subprocess.call(['clear']) # *nix call
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: how to clear the console when the programm is running (not manually) - by wavic - Sep-30-2017, 09:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  manually input data jpatierno 0 348 Nov-10-2023, 02:32 AM
Last Post: jpatierno
  embed python script in C programm gucio321 0 610 Feb-11-2023, 10:47 AM
Last Post: gucio321
  User serial/pyserial to send messages to an arudino via terminal manually bkapadia 2 2,751 Mar-10-2021, 11:26 AM
Last Post: Larz60+
  to call via console a python-programm Liki 9 3,259 Nov-22-2020, 01:10 AM
Last Post: bowlofred
  Problem running script within console koepjo 3 9,915 Mar-26-2020, 07:11 AM
Last Post: koepjo
  Manually create a hex value Stas43 5 3,039 Feb-27-2020, 08:28 AM
Last Post: Stas43
  How to manually define color bar scale in seaborn heatmap SriRajesh 3 18,351 Sep-08-2019, 11:12 AM
Last Post: RudraMohan
  Keypress when running a python app in a console on windows Stephen 6 9,026 Apr-16-2019, 12:38 PM
Last Post: Stephen
  keep running Console Application MrJoo 3 3,097 Dec-25-2018, 08:59 PM
Last Post: metulburr
  How to clear IPython console in Spyder? Vai 7 55,991 Aug-20-2018, 09:43 PM
Last Post: james_balcomb

Forum Jump:

User Panel Messages

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