I'm working on a tictactoe game and the output gets really messy and untidy after some inputs by the user, so is there any library or something I can use to clear the output screen after some time. The only method I know of works only for jupyter notebook. I'm using pycharm.
            Asked
            
        
        
            Active
            
        
            Viewed 135 times
        
    0
            
            
        - 
                    check [this](https://stackoverflow.com/questions/517970/how-to-clear-the-interpreter-console). – Me Bottle O Scrumpy Mar 05 '22 at 11:11
- 
                    1Does this answer your question? [How to clear the interpreter console?](https://stackoverflow.com/questions/517970/how-to-clear-the-interpreter-console) – Marcel Wilson Mar 15 '22 at 16:01
2 Answers
0
            
            
        import os
os.system("cls")
cls would be clear on mac or linux This should clear console
 
    
    
        deateaterOG
        
- 111
- 1
- 3
- 9
- 
                    So if you are publishing you could do a if and find the the platform then run the respective command – deateaterOG Mar 05 '22 at 11:20
- 
                    
- 
                    [for reference](https://www.delftstack.com/howto/python/python-clear-console/) – Edo Akse Mar 05 '22 at 12:43
0
            
            
        I think you can use the OS library and run clear command
import os
os.system("clear")
 
    
    
        Badrelden Ahmed
        
- 106
- 2
- 5
 
    