Jump to content
  • Advertisement
Sign in to follow this  
steveworks

How can you clear the command line?

This topic is 3542 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When you run python programs you most obviously use a command line. My question is "Is it possible to clear the visible text on the command line without stopping the program?" I am trying to make a clean looking text based game but it looks awful when I try to make it just scroll down to look like a new screen.

Share this post


Link to post
Share on other sites
Advertisement
The easy way? Make a call to system("cls").

It's not 'proper', but it works if you don't want to do it the harder way of getting a handle to the console, and manually changing each cell to a space. [smile]

However, if you DO want to do it manually, it opens up new ways for you to play with the console. Colored text, colored backgrounds, writing text wherever you want on the console instead of one line after another, mouse input, things like that.

Read this...
...and this...
This too...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!