发布时间:2019-09-25 08:21:37编辑:auto阅读(4173)
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系统)上
52470
52389
42494
39402
33844
30805
29562
24478
24337
22707
20°
63°
261°
268°
276°
321°
267°
402°
384°
409°