I am writing a lengthy arcpy tool and am working with multiple python scripts, simply for organization's sake. Everything runs well when I run it from the command line, but now that I am starting to think about converting it to a script tool, I am getting a headache.
My previous structure: parameters.py - lists all globals (parameters, functions, variables)
a_functions.py, b_functions.py, etc. - lists functions for use in main code, imports parameters with *
maincode.py - calls functions from *_functions.py, imports parameters with *
The structure is quite neat, and although it may not be ideal from a file structure standpoint, it works well enough (please chime in if I am doing something horribly wrong). Now that I need to load a file into the script tool that defines the parameters, I can't simply move all the parameters to the main code file, as I need to import them as globals to the other files, and importing with * will also import all the globals local to maincode.py. I could just move everything into one file, but all the organization would be lost and it would be a big mess. Does anyone have any suggestions who has built a lengthy arcpy tool with multiple files before?
