This module contains other assorted bits and pieces that don't fit into any other utility module.
) |
Examples of returned values:
linux-i586
linux-alpha
solaris-2.6-sun4u
irix-5.3
irix64-6.2
For non-POSIX platforms, currently just returns sys.platform
.
pathname) |
new_root, pathname) |
) |
s, local_vars) |
$
followed by a name is considered a variable, and
variable is substituted by the value found in the local_vars
dictionary, or in os.environ
if it's not in local_vars.
os.environ is first checked/augmented to guarantee that it contains
certain values: see check_environ(). Raise ValueError
for any variables not found in either local_vars or os.environ
.
Note that this is not a fully-fledged string interpolation function. A
valid $variable
can consist only of upper and lower case letters,
numbers and an underscore. No { } or style quoting is available.
exc[, prefix=tex2html_deferred"'error: '"]) |
s) |
func, args[, msg=None , verbose=0 , dry_run=0 ]) |
val) |
True values are y
, yes
, t
, true
, on
and 1
; false values are n
, no
, f
, false
,
off
and 0
. Raises ValueError if val
is anything else.
py_files[,
optimize=0 , force=0 ,
prefix=None , base_dir=None ,
verbose=1 , dry_run=0 ,
direct=None ]) |
0
- don't optimize (generate .pyc)
1
- normal optimization (like "python -O")
2
- extra optimization (like "python -OO")
If force is true, all files are recompiled regardless of timestamps.
The source filename encoded in each bytecode file defaults to the filenames listed in py_files; you can modify these with prefix and basedir. prefix is a string that will be stripped off of each source filename, and base_dir is a directory name that will be prepended (after prefix is stripped). You can supply either or both (or neither) of prefix and base_dir, as you wish.
If dry_run is true, doesn't actually do anything that would affect the filesystem.
Byte-compilation is either done directly in this interpreter process
with the standard py_compile module, or indirectly by writing a
temporary script and executing it. Normally, you should let
byte_compile() figure out to use direct compilation or not (see
the source for details). The direct flag is used by the script
generated in indirect mode; unless you know what you're doing, leave
it set to None
.
header) |
See About this document... for information on suggesting changes.