0

I'm trying to clear the shell window when the actual code runs. I've done a couple different searches and saw some options but none seem to work. Here is the one I've been trying to get to work (I'm using Python 3.8.1).

import os
os.system('cls')
  • What OS are you using? Possibly duplicate: https://stackoverflow.com/questions/517970/how-to-clear-the-interpreter-console – sshashank124 Jan 06 '20 at 08:17
  • @sshashank124 I am using Windows 10. I tried this one and it doesn't work. It does create a line in the shell saying the shell was restarted but all of the information in the shell is still displayed (cluttered). I'd be ok with a close and re-open of shell, but can't figure out how to do that in the code either. – Jason Hatt Jan 06 '20 at 08:22
  • Please have a look through the answers of the linked duplicates. If they don't answer your question, you can ask for a reopen on your question – sshashank124 Jan 06 '20 at 08:23
  • You are probably using an IDE with an inbuild shellwindow that can not be cleared that way. Unless there is a way to influence how your IDE displays the shell, there is no way to clear it. Which IDE are you using? – Patrick Artner Jan 06 '20 at 08:30

0 Answers0