Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Pycharm Clear screen

Hi Guys, I've recently started to learn to program with Python and I am using pycharm on my PC. On one of the earlier lessons Kenneth used made a project that would clear the screen to clean up as he went however in pycharm this doesn't work instead all you get is a little square in the window and it clears nothing. Any ideas?

hi Quinn!

Can you provide the link for that lesson? I mean, the one he shows the "clear screen".

Cheers.

5 Answers

The clear screen function Kenneth wrote in this video won't work inside of PyCharm's run window, so you're probably doing it right. :D That function will only work in a terminal window.

Here is a link to the video that refers to the project that uses these commands.

https://teamtreehouse.com/library/python-basics/letter-game-app/letter-game-refinement

I tried my code for the letter game in Pycharm.

It works but really weird...................

For instance I get some little squares before the "Welcome to Letter Guess!" message (tried to copy/paste but it doesnt show here). And some ">?" here and there.

mmmm gotta dig deeper. Its probably a pycharm thing and needs some tweaking.

Ill let you know if I find something.

:(

Thanks Nicolas, I tried googling information about it but couldn't find anything either.

You can create your own keyboard shortcuts in PyCharm:

  1. Open Pycharm preferences
  2. Search: "clear all"
  3. Double click "clear all" -> add keyboard shortcut (set it to CTRL + L or whatever you'd like)
  4. Make sure to click in the console (or Run window) before using the shortcut or it doesn't do anything.

Here is a way to do it in pycharm https://stackoverflow.com/a/47367480/5424873