发布时间:2019-09-25 08:21:37编辑:auto阅读(3893)
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系统)上
51028
50415
41024
37888
32354
29251
28133
22969
22931
21259
1133°
1837°
1485°
1422°
1708°
1513°
2172°
3746°
3672°
2585°