发布时间:2019-09-25 08:21:37编辑:auto阅读(4032)
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系统)上
51746
51427
41839
38612
33105
30096
28766
23764
23679
22047
76°
2274°
2967°
2472°
2415°
3014°
2423°
3229°
5321°
5145°