[英]Where should my Python package add files on a user system?
I want my package to add a SQLite file either at time of package install or upon running an initialization method.我希望我的包在安装包时或运行初始化方法时添加一个 SQLite 文件。
Is there a conventional place where that file should live?是否有该文件应该存放的传统位置?
/usr/local
directory./usr/local
目录中。~
home directory of /Users/<current_user>
/Users/<current_user>
~
主目录中I have no experience in this area, but I am leaning toward a hidden .my_package
directory at ~
because when I look at my home this is what I see:我在这方面没有经验,但我倾向于隐藏
.my_package
目录~
因为当我看着我的家时,我看到的是:
.conda
.docker
.ipython
.jupyter
.matplotlib
...
无论平台如何,您可能都希望使用appdirs
包来确定正确的目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.