It looks like you're new here. If you want to get involved, click one of these buttons!
Hi Matt,
Can I import self defined module in different python file in klayout batch mode?
Something like below usage
from self_module import module # import self defined module in different python file
BG,
KM
Comments
Sure, you can.
In order to locate the file, either put it into one of the Python locations, KLayout offers. Or set the "KLAYOUT_PYTHONPATH" environment variable to point to your module (same as PYTHONPATH for the normal Python interpreter).
Finally, you can also add your module's location to "sys.path" inside your code.
It's getting more difficult if your module involves binary extensions. In this case, the extension needs to be compatible with KLayout's build (same runtime etc.).
Matthias