On this page
os.uname_result
Prev: os.times_result | Up: os | Next: os.unlink
Rel: os.abort, os.access, os.chdir, os.chmod
Ref: docs.python.org โ os.uname_result
Tags: #public #python3 #stdlib #os
Import
import os
from os import uname_result
Signature & Overview
os.uname_result(iterable=(), /)
uname_result: Result from os.uname().
Methods & Attributes
uname_result.count(self, value, /)โ Return number of occurrences of value.uname_result.index(self, value, start=0, stop=9223372036854775807, /)โ Return first index of value.
Usage
import os
if hasattr(os, "uname"):
u = os.uname()
assert isinstance(u, os.uname_result) and len(u.sysname) > 0
Gotchas
- Unix-only: Use
platform.uname()for a cross-platform version that also works on Windows.
REPL Inspect
from os import uname_result
help(uname_result)
Linked from
Related notes
- tuts/python3/stdlib_module/os/times_result Linked here; links to this page; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/unlink Linked here; links to this page; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/os/abort Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/access Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chdir Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chmod Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chown shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/close shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/cpu_count shared tags: #os, #stdlib