python - Finding the user's “Downloads” folder

后端 未结 4 1887
逝去的感伤
逝去的感伤 2020-12-05 14:53

I already found this question that suggests to use os.path.expanduser(path) to get the user\'s home directory.

I would like to achieve the same with the

4条回答
  •  感情败类
    2020-12-05 15:34

    For python3+ mac or linux

    from pathlib import Path
    path_to_download_folder = str(os.path.join(Path.home(), "Downloads"))
    

提交回复
热议问题