os.path.
join
(路径,* 路径小号)
智能地加入一个或多个路径组件。返回值是路径和* path s的任何成员的串联,在除了last之外的每个非空部分之后只有一个目录separator(),这意味着如果最后一部分为空,结果将仅在分隔符中结束。如果组件是绝对路径,则抛弃所有先前组件并从绝对路径组件继续连接。
os.
pathsep
The character conventionally used by the operating system to separate search path components (as in PATH
), such as ':'
for POSIX or ';'
for Windows. Also available via os.path
.
os.
sep
The character used by the operating system to separate pathname components. This is '/'
for POSIX and '\\'
for Windows. Note that knowing this is not sufficient to be able to parse or concatenate pathnames ---use os.path.split()
and os.path.join()
--- but it is occasionally useful. Also available via os.path
.
os.environ['CUDA_HOME']
获得环境变量‘CUDA_HOME’的路径