Think before you speak, read before you think.

python 获取 home 路径

写脚本有需求把 cache 保存在 $HOME。获取路径可以使用

os.path.expanduser('~')

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *