
98
|
Python Pocket Reference
times()
Returns a five-tuple containing elapsed CPU time infor-
mation for the calling process in floating-point seconds:
(user-time, system-time, child-user-time, child-system-
time
, elapsed-real-time). Also see the section “The time
Module,” later in this book.
tmpfile()
Returns a new file object opened in update mode ('w+').
The file has no directory entries associated with it and
will be automatically deleted once there are no file
descriptors for the file.
umask(mask)
Sets the numeric umask to mask and returns the prior
value.
uname()
Returns OS name tuple of strings: (systemname, nodename,
release, version, machine).
confstr(name)
confstr_names
sysconf(name)
sysconf_names
System configuration value access (see the Python
Library Reference for details).
File Descriptor Tools
The following functions process files by their descriptors (fd
is a file-descriptor integer). os module descriptor-based files
are meant for low-level file tasks and are not the same as
stdio file objects returned by the built-in open function
(though
os.fdopen and the file object fileno method convert
between the two). File objects, not descriptors, should nor-
mally be used for most file processing.
close(fd)
Closes file descriptor fd (not a file object).