Clearing the Python Console
已回答
I was shown that importing replit and using the clear() console works on other compilers (such as Repl). However, when I try this in Pycharm nothing happens.
import replit
replit.clear()
neither clears the console or gives an error.
The use case specifically calls for a cleared console, without the ability to scroll up (so repeating newlines will not work).
I am currently researching other ways to do this. But I am a bit surprised that a function that works just fine in other consoles won't work in Pycharm. Does anyone have a solution?
I'm trying to use keymap and pyautogui right now but it's not intuitive or working as yet.
Thanks in advance.
请先登录再写评论。
It seems to be a bug. I filed a ticket to our issue tracker about that https://youtrack.jetbrains.com/issue/PY-48641, feel free to vote for it and comment.
Instead, you can use PyCharm's feature for clearing the console. Right-click inside the output area and choose Clear All:
I'm sorry for the inconvenience.
But how to automate this process of clearing the screen all the time we hit run.
we can not define this on a certain place in th between our code. What's the solution to this/
thank you. I tried it but it said no module called replit