How to delete a specific print line in cmd Python

Asked

Viewed 562 times

1

Lately I have appeared an error using lib progressbar2 to create a bar in windows 10.

When I put it in full screen or decrease the size it starts to create bars:

1 Error

I solved the error by cleaning cmd with lib os but I needed to be shown some previous information.

With this experience I realized that the error has to do with the increase and decrease of the number of lines and therefore it does not erase the line with the command r.

What I would like to do is delete the lines that were under a specific line in the case would appear 'Loading...' and down the bar and I would like to delete all the lines under 'Loading...'. If there is no way to do this I would like an indication of how to make a better bar.

1 answer

1

You can use the lib tqdm it has some very interesting bars and it may be that the result avoid the situation you found, in their link you have even a gif with examples of lib use.

Here, a simple example:

from tqdm import tqdm
    for i in tqdm(range(10000)):
        ...
  • If it doesn’t work, show me how it looks so I can help you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.