sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #05754
[Question #172705]: NameError: global name 'XXX' is not defined since reload is used instead of execfile
New question #172705 on Sikuli:
https://answers.launchpad.net/sikuli/+question/172705
Hi, Since I used
import MODULE
reload(MODULE)
from MODULE import *
I have some problems with my code.
I have a main file where I call all my definitions:
if __name__ == "__main__":
snap = Output(snapOutput,0)
usual = Usual()
os.system('\"c:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe\" "http://127.0.0.1:80"')
usual.open_Webstart()
then in Usual class:
def open_Webstart(self):
try:
wait(General_IMG_StoneGate_WebStart)
snap.take_screen_shot()
click(General_IMG_Webstart_Link)
snap.take_screen_shot()
wait(General_IMG_Webstart_Java_Open)
doubleClick(General_IMG_Webstart_Java_Open)
snap.take_screen_shot()
click(General_IGM_Webstart_Open_With)
snap.take_screen_shot()
click(General_IMG_Webstart_Java_OK)
snap.take_screen_shot()
except:
snap.log_error()
Before when I was using execfile (#execfile(myScriptPath + "\\IPS.sikuli\\IPS.py")) it was working fine but now at each execution it complains about
snap.take_screen_shot()
NameError: global name 'snap' is not defined
Can someone explain me please ??
Thanks in advance.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.