简体   繁体   中英

How to clear python interpreter in visual studio 2019

I want to create simple animation using python that will:

  1. Print diagram with some data in it
  2. Clear the dialog window
  3. Print another diagram with some other data in it

I am supposed to use Visual Studio 2019 in this project. Sadly, os.system('cls') - I am using Windows - won't work, I get such output:

Some text 1
♀some text 2

Where in place of '♀' cleared window is expected. Any thoughts?

This is know issue and reported earlier. os.system('cls') prints control character and does not clear the screen.

Please see: os.system('cls') does not clear the screen when redirect is enabled .

The error behavior is reproducible on my Windows 10 PC using Visual Studio 2019:

在此处输入图片说明

Note that disabling redirect output solves the issue:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM