For details see here: https://www.klayout.de/forum/discussion/2790/importing-py-files-from-technology-directory#latest
For details see here: https://www.klayout.de/forum/discussion/2790/importing-py-files-from-technology-directory#latest