how to import a file in other file between middle of the code
Hello,
I want import one file in main file, but when i try to do that i got an error like,
[error] Error message: Traceback (most recent call last):
File "C:\DOCUME~
import MSTSC_SIM
File "C:\Program Files\Sikuli X\sikuli-
File "C:\Program Files\Sikuli X\sikuli-
ImportError: Errors in loading sikuli module: MSTSC_SIM
'with' will become a reserved keyword in Python 2.6 (MSTSC_SIM.py, line 62)
- HOW TO FIX? Try adding "from sikuli import *" in the module.
my code is:
#### MSTSC_SIM.sikuli
from sikuli import *
import shutil
import os
def startMstsc(event):
type(
wait(1)
paste("mstsc")
type(Key.ENTER)
doubleClick
type(
type(
click(
click(
click(
type(Key.ENTER)
alertImg = "Dol.png"
if exists(alertImg):
wait(5)
else:
wait(7)
doubleClick
#main operation
#startMstsc(1)
#######Main.sikuli
import csv
if ((scnName == "general") & (stpTest == "STP-GPSBL-002")): #checking the condition
print "Done"
import main
reload(main)
from main import *
startMstsc(1)
try:
startApp(1)
except FindFailed:
print "img not found on the screen"
please solve my doubt, Here i want to call the function inside the if condition.
Thank you in advance :)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: