Closed iCHAIT closed 8 years ago
This isn't really something that Python has strong conventions for, but personally I think:
setup.py
), and it is often not user-writeable.tempfile
module./home/someuser/.mypackagename
). This is a location that's both un-surprising to the user and is very likely to succeed without permissions errors. You should get the path to the home directory with os.path.expanduser("~")
so that it's cross-platform. If you need multiple files, make .mypackagename
a directory instead, and put files inside it./usr/local/share/mypackagename
on POSIX systems.Also, those files should not be defined in setup.py
at all: your setup.py
should only reference read-only files which are included with the package.
Thanks a lot :+1:
FIxed using os.path.expanduser("~")
Hi, thanks for this great tutorial, I wanted to ask a question -
My python script which I have packed writes to a file, this file is not shipped with the package so in essence it is created on the fly for the user (that is when he runs the package.).
Now I want to know, how do I handle such a file?
Currently I have not specified it in my setup.py because it has not been shipped with the package, do I need to define it in setup.py and maybe ship it is an empty file?