Python allows to bundle a lot of Python files with py2exe in one executable for Windows. That way a simple call of this exe allows to start the Python program. No installation is required. I don't like windows and use Linux instead. That's why I had to search for a similar solution on Linux. I just want to have all my Python code bundled in one shell script and to be able to distribute one bash file only instead of the whole set of python files.
 

I found this site. In addition (because it's referred by the previous site) I found the Python Cookbook from Oreilly. There it's desribed in detail how this method works with some restriction which are removed in the first link. Unfortunately I had problems when I called my generated shell script. Everytime I got.

 
traceback (most recent call last):
  File "<string>", line 17, in <module>
ImportError: No module named main

 
It's not that difficult to fix this - if you read the doc about Modules and Packages on python.org
 
I had defined a file collectNWData.py which has a main defined. Then I changed in the template script
 
import main
main.main()
 
into
 
import collectNWData
collectNWData.main()
 
and everything works as expected.
 

Kommentar schreiben

Spam Kommentare sind sinnlos !
Vor der Publizierung wird jeder Beitrag auf Spam geprüft. Leider dauert es deswegen bis ein Kommentar sichtbar wird. Dafür erhält aber kein Subscriber Spam eMails.
Die eMail ist optional und nicht öffentlich sichtbar. Sie ist notwendig um eMail Benachrichtigungen zu Antworten auf Kommentare zu erhalten. Sie wird auch u.U. auch vom Seitenbetreiber genutzt um offline Kontakt aufzunehmen.

Spam comments are useless !
Any comment will be reviewed first and checked for spam. Unfortunately this delays the publishing of comments but will protect subscribers from spam.
eMail is optional and hidden and is required to get update notifications for any comments. In addition your eMail may be used by the website owner to get in contact with you offline.