发布时间:2019-09-25 08:21:37编辑:auto阅读(3608)
python获取当前用户的主目录路径, 示例代码如下:
#! /usr/bin/python
# -*- coding: utf-8 -*-
import os
print os.environ['HOME']
print os.path.expandvars('$HOME')
print os.path.expanduser('~')
上一篇: Python(3)
下一篇: 如何在同一台电脑(windows系统)上
48618
47607
38406
35627
30071
26801
25805
20686
20430
18832
121°
197°
237°
253°
249°
254°
292°
347°
476°
461°