I am trying to check is osys
variable is not equal to 'Linux'
. The output of platform.system() on my machine is 'Linux'
. This then gets assigned to the variable of osys
.
def getos():
osys=platform.system()
if osys is not "'Linux'":
print(color.lightred + "This program only runs on Linux operating systems.")
time.sleep(2)
quit()
getos()
I am using this code to check if osys
is 'Linux'
, and if not the program will close because the program only works on linux. Instead when I run this code I always get the output string of This program only runs on Linux operating systems
instead of the code just continuing. Does anyone know how to fix this.