开发者

pyqt gui application packaging for ubuntu

开发者 https://www.devze.com 2023-03-31 12:29 出处:网络
I am really new to packaging. I have developed a music player using pyqt in ubuntu. It has a gui and it uses sqlite database.

I am really new to packaging. I have developed a music player using pyqt in ubuntu. It has a gui and it uses sqlite database.

I have looked at distutil. What I understood is how to place modules and scripts in right place. What I don't understand is how to set paths for database, config files & log files. How do I achieve it the way other applications do it in ubuntu by maintainig all this data in '.application_name' folder under home for a user ?

Can anyone s开发者_运维问答uggest a good example application to learn from or point in some direction?


You can use QDir.home() to get the absolute path to a user's home path. You can use this path when generating/accessing your database, config files and log files. For example, on first startup you can do something like:

filePath = QDir.home() + "/.application_name"
if not QDir.exists(filepath)
    QDir.mkdir(filepath)

Then you can use filePath when reading/writing to the files from there on out.

0

精彩评论

暂无评论...
验证码 换一张
取 消