Ask coding questions

← Back to all posts
From replit import clear is no longer supported?
Dart (1200)

Ok so from my understanding you have to require something else, but why? Not to long ago you only had to import clear from replit and it would work and I have no idea why they would change it I guess I have to go back and define a clear function with os now

Answered by mat1 (4456) [earned 5 cycles]
View Answer
mat1 (4456)

from replit import clear should still work in Python. If you want to do it in another language (or don't want to import anything), just print \033[H\033[2J. This will move the cursor to the beginning of the terminal and delete all the text on it.

Dart (1200)

@mat1 it sadly does not work for me, why was it discontinued in the first place?

mat1 (4456)

@Zexogon I just tried and it doesn't work now, weird. Just try the alternative I gave or install replit from the package manager (I made the package and the only function it has is clear)

slip1244 (257)

@Zexogon u gotta import it from package manager again but if that doesnt work then mat's is good


well, os clear is better


I agree