python获取当前用户的主目录路径方法(推荐) Python获取当前用户的主目录路径,示例代码如下:#!/usr/bin/python#-*-coding:utf-8-*-importosprintos.en 用户主目录