Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Importing libraries in Python Toolbox

$
0
0
I have developed a library in Python which I would like to utilize in a Python toolbox by importing it in the "execute" method of the Tool class, like so:

Code:

    def execute(self, parameters, messages):
        import timesheds
        timesheds.main([parameter.valueAsText for parameter in parameters])

This works but is difficult to debug, because when I make changes to the imported library (timesheds), they aren't reflected in the tool run even when I refresh. That is, changes to the .pyt code take effect, but not changes to timesheds.py. Is there a way to make changes in the imported library without creating a new one each time?

Viewing all articles
Browse latest Browse all 2485

Trending Articles