I’m trying to write a Gnome applet in Python. In fact, I’ve written the app and I’m stuck when it comes to packaging it.
I started by looking into distutils. The problem I ran into right away was that when specifying py_modules, an extension of .py is expected. However, Gnome applets are basically shell scripts. (That use the Python interpreter, of course.)
Here is what I tried… but it isn’t working.
from distutils.core import setup
setup(name='myapp',
version='1.2',
py_modules=['myapp'],
)
Also, the myapp file has to get put in /usr/lib/myapp/. As far as I know, distutils puts the files in with the other modules.
How should I go about doing this?
Scripts should be installed with the
scriptoption todistutils.core.setup()as described indistutilsdocumentation. On the other hand,py_modulesis used to list individual modules, and they must have.pyextension as you described.Also, if you want to add additional files, the
data_filesoption lets you specify both source and destination of the files.Answer summary: Read whole
distutilsdocumentation.