发布时间:2019-09-25 08:21:37编辑:auto阅读(4026)
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系统)上
51714
51373
41805
38578
33058
30070
28738
23733
23645
22013
2228°
2914°
2436°
2384°
2954°
2386°
3193°
5246°
5059°
3612°