I realize this question might be better asked on stackoverflow, but the people here are a lot friendlier. I have developed several functions that I am starting to use in all of my code, my own personal library. I’ve looked at the python documentation on how to setup libraries and files for import and frankly I think I’m more confused now. What I want is a way to include my file in each file with import or some other similar command so that I can call the functions in there from my AD code. Sounds simple right???
Moved this to the dev section, Chip - if there’s no response, you might want to try Gitter chat; there’s a lot of devs hanging out there and someone should be able to help you out.
the closest to an answer I got in the dev section was someone telling me to put my code in the custom_controls directory. Should it just be in the custom_controls directory, or in a sub directory under it? I tried asking on the chat but if someone was trying to help me past that, I couldn’t find in mixed in with all the other messages.
I agree about gitter, too many people talking across each other. I can’t follow anything.
This link from stackoverflow seems pretty comprehensive about importing Python files.
Great,
Where does “self” fall into this? When I have tried some of these I always have to reference them with the “filename”.function not self.function.
self refers to the object that the method is a part of. Its actually the first parameter of a method, and only by convention is it called self. See 9. Classes — Python 3.12.2 documentation