How to bundle many python scripts into one program [Linux]

Hi, so I've been writing a bunch of scripts for editing config files, now I've currently written it as several separate small programs, but I want to bundle it into a master program so that you can choose for any of the options instead of having to call separate python programs for each task.

How would I go about doing that? Bonus points if I can bundle it into a single file to avoid clutter.

use multiple files, give them each a directory to identify (main program will read folder names starting with program_XXX giving you options to select XXX or YYY
you can handle user i/o per program basis. the main will include the folder main.py file and it does the rest.

additionally use git to have a reasonable version control, perfect for changing stuff and push packups to a local/remote server

I see no point in having multiple scripts that are useful in a single file.
You might also want to add the possibility to execute the sub program without user interaction (for other scripts to call it) so you might want to pre define what you really want. like:
<mainprogram> <subname> [<argument(s)>]

right now I need the program to have a text based interface, then I will make a second program that takes command line args. (since most of the heavy lifting has been done it would be trivial)

so you're saying is keep the programs seperate but have a main program that calls them from a sub directory?

with the subdirectory structure you simply add a new plugin_xx folder and have it in your menu
(at least thats what I would do + checking if needed files exist)

would make it simple to add new stuff and no changes in master program needed.

hmm I will consider it. I might merge into one big file seeing as I just merged two of the scripts because of lots of overlap

1) Re-write everything into classes/functions
2) You wouldn't want it as one giant file, that would be way more unmanageable
3) Setuptools https://python-packaging.readthedocs.io/en/latest/

1 Like

thats what I've currently done, its one big file atm with allot of function and a main, I'll look into what you posted.