I am making a quiz game and I want to make it so that when ever you go to test mode it will clear your screen. I want the program to be compatible with UNIX and windows. I want it to make it so that if the system is windows, it runs cls in the terminal, and if your on Linux it runs clear. I have nothing wrong with my code, I just can find what I want to do online.
>Solution :
os.name would return nt if your system is Windows, and posix if POSIX, so you can do it like this
import os
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')