2022-12-13 13:08:12 -05:00
|
|
|
# This module is not entirely compatible with CPython
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
os.putenv("TEST_VARIABLE", "TEST_VALUE")
|
|
|
|
|
|
|
|
print(os.getenv("TEST_VARIABLE"))
|
|
|
|
print(os.getenv("TEST_VARIABLE", "TEST_DEFAULT_VALUE"))
|
|
|
|
|
|
|
|
os.unsetenv("TEST_VARIABLE")
|
|
|
|
|
|
|
|
print(os.getenv("TEST_VARIABLE"))
|
|
|
|
print(os.getenv("TEST_VARIABLE", "TEST_DEFAULT_VALUE"))
|
|
|
|
|
2023-08-23 09:57:23 -04:00
|
|
|
print(os.system("exit 0"))
|
2022-12-13 13:08:12 -05:00
|
|
|
|
|
|
|
rand = os.urandom(4)
|
|
|
|
print(type(rand) is bytes, len(rand))
|
|
|
|
|
|
|
|
os.errno(2)
|
|
|
|
print(os.errno())
|