Core & system · BUILT-IN MODULE

os

Operating-system and environment helpers.

Quick start

use os
use os

say os.platform
say os.cwd
if os.has_env "HOME"
    say os.getenv "HOME"

API reference

os.platform

Current platform name.

Current platform name.
os.cwd

Current working directory.

Current working directory.
os.getenv name

Read an environment variable.

讀取 an environment variable.
os.has_env name

Check whether an environment variable exists.

檢查是否 an environment variable exists.