I've been a C#/ArcObjects developer most of my career and am finally starting to switch to Python and ArcPy, so I'm still fairly new to that world. I'm creating a bunch of tools that are used by multiple people. Is there a way for me to create a library of common functions that my geoprocessing tools can call? If so, how can I make sure that my users will have the necessary files on their computers? We store our toolboxes and scripts on the network, in case that makes a difference.
Thanks!
Solved! Go to Solution.
You can indeed create your own modules and import them just like you do with the built-in modules.
Python Modules: Learn to Create and Import Custom and Built-in Modules
The location of the file needs to be in the module search path if the computer's Python environment.
You can indeed create your own modules and import them just like you do with the built-in modules.
Python Modules: Learn to Create and Import Custom and Built-in Modules
The location of the file needs to be in the module search path if the computer's Python environment.
Thanks Blake! How/where do you store the modules so everyone has access to them?
Here's an article that goes a little more in-depth on how to save the files so they can be imported.
https://stackabuse.com/python-modules-creating-importing-and-sharing/#usingamodule
Thank you so much, Blake, this is perfect!