1

My Python (3.7) program is split into a number of files just for sake of convenience of development (e.g. Pycharm becomes slow when a module is too big) but I would like to distribute it to end-users as a single py file they can just put anywhere, click and run. This is fairly easy to do manually but that takes some time to copy-paste everything so it would be handy to automate this. Is there a tool for this already or should I write it myself? If I should then should I do it the dumb way by concatenating files and removing imports or are there some functions to do it a right way parsing modules and analyzing imports so the script could actually understand the program structure?

Ivan
  • 63,011
  • 101
  • 250
  • 382
  • 2
    Have you tried setuptools? You can create windows installer, linux deb etc. Check out this sample on their documentation. https://pythonhosted.org/an_example_pypi_project/setuptools.html – MUNGAI NJOROGE Dec 06 '18 at 10:14
  • Thanks. I have used setuptools previously and can say it's fairly nice but in this case I'd prefer the zero-install script-style way. – Ivan Dec 06 '18 at 10:17
  • what about using one of the tools to turn it into a binary? that way all your dependacies are inside a single binary – Srgrn Dec 06 '18 at 10:23
  • I specifically intend the users to hack on the source code "on the fly" between the program runs. – Ivan Dec 06 '18 at 11:21

0 Answers0