How to determine the Dropbox folder location programmatically?

前端 未结 8 1179
故里飘歌
故里飘歌 2020-12-06 09:38

I have a script that is intended to be run by multiple users on multiple computers, and they don\'t all have their Dropbox folders in their respective home directories. I\'d

8条回答
  •  长情又很酷
    2020-12-06 10:16

    This adaptation based on J.F. Sebastian's suggestion works for me on Ubuntu:

    os.path.expanduser('~/Dropbox')
    

    And to actually set the working directory to be there:

    os.chdir(os.path.expanduser('~/Dropbox'))
    

提交回复
热议问题