This is a question for users of the graph transformation tool booggie:
In a script, is there a way to import an external python module in an arbitrary .py-file and use it like a regular python module within a script?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s good practice to write a setEnvironment-script that adds required directories in the Python environment. As the location of the directories might vary from different computers, it’s helpful to add a computer-name-switch.
The script looks like this:
Now, you can import in any rule the modules, i.e. .py-files, in *source_path*. Make sure that you import within the script such that the import is done after the path is added. If you want to continue coding in your python module you can make sure to always get the latest version if you always reload the module. Hence in any script you can add this (assuming myHelper.py lies in the source path):