Python posix Module
Note: The posix
module is Unix-only.
Example
Show the current process ID (Unix only):
import posix
print(posix.getpid())
Try it Yourself »
Definition and Usage
The posix module exposes a POSIX-style operating system interface.
Most users should import os
instead; on Unix, os
wraps and exposes posix
in a portable way.
Members
Member | Description |
---|---|
environ | Mapping of environment variables. |
fork() | Create a child process (Unix only). |
getcwd() | Return the current working directory. |
getpid() | Return the current process ID. |
kill() | Send a signal to a process. |
listdir() | List directory entries. |
makedirs() | Create directories recursively. |
remove() | Remove (delete) a file. |
rmdir() | Remove (delete) a directory. |
stat() | Get information about a file or path. |
uname() | Return system identification information. |