Import custom functions

3 posts / 0 new
Last post
Duygu
Offline
Joined: 02/06/2021 - 11:46
Import custom functions

Hi everyone,
I have written several .py files and tried to import them to my main file. The program works on terminal; however when I try to run it on IDEA it doesn't work. It halts at "Python script is running" and nothing happens. I put all the files in Macros.ILB, but sstill don't work. Should I put them on a different directory?
Thanks in advance.

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

They generally need to be in the same directory as the calling python script so that the script will be able to find them.  

Duygu
Offline
Joined: 02/06/2021 - 11:46

I put them in the same Macros.ILB directory, but main python script couldn't import the other .py files. I also addded absolute path for imports. Should I do something different?