← Back to team overview

sikuli-driver team mailing list archive

[Question #173326]: How can I reload a relative Import?

 

New question #173326 on Sikuli:
https://answers.launchpad.net/sikuli/+question/173326

I have an import library which just has a bunch of common tasks and functions.  I could import the whole module, but would prefer to just import the functions that are needed for that particular script.  here is some code where I do the import itself:


import sys
importPath = r"C:\Users\hreadinger\Documents\AutomationFW\imports"
if not importPath in sys.path: sys.path.append(importPath)
from masterImport import openTicket , resolveTicket , reset

SO that works fine, no problems.

THe problem comes when, using the Sikuli IDE,  I need to reload the import to test a new function i added. 

There are currently two workarounds to that problem:
    1) restart the IDE
    2) use a reload(module)

using a relative import, i can't use reload(module), as it errors "NameError: name 'masterImport' is not defined"

Is there a way to reload a relative import?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.