发布时间:2019-09-25 08:21:37编辑:auto阅读(4276)
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系统)上
53046
39975
34353
30109
25002
24808
23181
16647
14822
14321
637°
599°
659°
667°
720°
845°
815°
842°
931°
854°