Код: Выделить всё
if __check_freebsd__():
# run actions which would only work on FreeBSD (e.g. create a jail)
elif __check_debian__():
# run an alternative that runs on Debian-based systems
else:
raise Error("unsupported OS")
У меня есть следующий код для __check_debian__< /code> уже:
Код: Выделить всё
try:
lsb_release_id_short = sp.check_output([lsb_release, "-d", "-s"]).strip().decode("utf-8")
ret_value = "Debian" in lsb_release_id_short
return ret_value
except Exception:
return False
Подробнее здесь: https://stackoverflow.com/questions/300 ... hon-script
Мобильная версия