calling functions between multiple files
I have 2 files that need to call functions from each other. The problem is that I get an error
NameError: global name 'main' is not defined
my two files are as follows (i have cut out a bunch of stuff to narrow in on the issue)
sarkoth.sikuli
import general
from sikuli import *
from general import *
def main():
do things
leave()
else:
leave()
runs=0
while runs>=0:
main()
general.sikuli
from sikuli import *
def leave():
type("t")
main()
sarkoth.sikuli is where my script is run from and it will call leave() which is located in my general.sikuli. The leave function executes but then gets hung up when its time for it to call main() from sarkoth.sikuli
i've also tried adding to the general.sikuli but it still doesn't work.
import sarkoth
reload(sarkoth)
from sarkoth import *
anyone have ideas?
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask alex for more information if necessary.