How to Py2app DATA_FILES?

Viewed 215

I made a software in Python 3.8 on Mac OS X 10.15 catalina. I would like to distribute my software to Mac OS X devices.

So I found the tool py2app. I need to add some files to my future app.

I am surprised they don't give any explanation about DATA_FILES !

https://prnt.sc/ug4gei

So I made a Google search about it and I just found some specific question on particular cases on Stackoverflow.

I found also some tutorial about how to compile a python code in app, but nothing consistent for DATA_FILES!

I also found the existence of some kind of "resource" folder option, and guess what! No tutorial, no doc, no article, no discussion, nothing. Maybe I misunderstood and this option doesn't exist.

I guess they are very busy to produce a full tutorial or documentation about their software, so I will simply present my needs here. I hope someone will have time to help me.

For my personal organization of my code and future distribution, I created in my project folder a folder named 'necessary_files' where I add some files and folders necessary to run my software properly.

These are the data I need to add in my app. These files and folder below are located in the root folder of my python project where is also my main code MyApp.py:

  • necessary_files/create_db.sql' => I don't need to recreate the 'necessary_files' folder, just need the create_db.sql file.

  • 'necessary_files/fra.traineddata' => no need to recreate the 'necessary_files' folder, just need the ui.txt file

  • 'necessary_files/ui.txt' => no need to recreate the 'necessary_files' folder, just need the fra.traineddata file

  • 'PhoneBot_Install.sh' => I need this file for installing some libraries in order to make work my software (ex:java JDK)

  • 'necessary_files/assets' => no need to recreate the 'necessary_files' folder, just the folder 'assets' and all the files included

  • 'necessary_files/cgi' => no need to recreate the 'necessary_files' folder, just the folder 'cgi' and all the files
    included

  • 'necessary_files/selenium' => no need to recreate the
    'necessary_files' folder, just the folder 'selenium' and all the
    files included

  • 'ui'=> This is a folder which I contains some stuff for my GUI made in PyQt5. I need this folder and all the files included.

The examples found on google are not understandable at all, as sometimes I find some tuples ,sometimes some list, sometimes both... without explanation it is hard to guess what is the syntax.

Also what about resource option? Does it exist and when should I use it?

Thanks in advance to the ones who will make Py2app more clear about adding data in an app.

0 Answers
Related