#! /usr/bin/python # -*- coding: utf-8 -*- import os print os.environ[‘HOME‘] print os.path.expandvars(‘$HOME‘) print os.path.expanduser(‘~‘)
获取 python linux Home目录
原文:https://www.cnblogs.com/SunshineKimi/p/10828970.html