Unix Platform Modules

resource

Queries and controls Unix process resource limits and usage. A soft limit is the enforced current limit; the hard limit constrains how far it can be raised. Availability and usage units differ by OS. This example inspects usage without changing limits or exposing machine-specific values.

Formal Syntax & Structure

python syntaxpython
import resource

Return Value

module

Module namespace available through import; import is a statement, not a value-returning expression.

Working Example

Example Snippetpython
import resourceusage = resource.getrusage(resource.RUSAGE_SELF)print(usage.ru_utime >= 0)
Python Reference