有三种获取home路径的方式
home_path = os.environ['HOME']
home_path = os.path.expandvars('$HOME')
home_path = os.path.expanduser('~')
有三种获取home路径的方式
home_path = os.environ['HOME']
home_path = os.path.expandvars('$HOME')
home_path = os.path.expanduser('~')
本文标题:python 取得当前用户的Home目录
本文链接:https://www.haomeiwen.com/subject/mqzozktx.html
网友评论