Ask coding questions

← Back to all posts
Clearing the terminal
LardBoi

I know python has import replit replit.clear() and it's said that it's only supported for python. I was just asking if that's true. I'm coding in C++ and want the terminal cleared.

Voters
kumorix
id100adi
LardBoi
Comments
hotnewtop
WendellFranco

Console.Clear();

LardBoi

@WendellFranco What language? also at the time of this C++ had no repl way of doing it like python did.

ash15khng

Currently replit.clear() is only supported on Python, but I think you can suggest it at repl.it/feedback but I think it is quite a popular suggestion so you may not want to make a new thread/post (whatever you call it)

LardBoi

@ash15khng Yes I know but

#include <iostream>
#include <replit>

int main()
{
cout << "Hello World!\n";
replit.clear();

return 0;
}

This doesn't work for C++

ash15khng

@LardBoi You can go and suggest it at repl.it/feedback I think

JoshDaBosh

https://repl.it/@JoshDaBosh/DearVigilantSandbox

There's a module called replit that you can import. Call it by taking any user input and calling replit.clear()