Here's My Problem:
I have three Python Modules (using 2.7.2)
TC_Config.py merely holds Common Variables used by both of the other two Modules.
pyTC.py is supposed to be a Test and Flow Control (Master) Module that once standardized will not be changed (much).
ptf.py is a module that will be unique to whatever test is being done.
import TC_Config from wx import * from time import * from visa import * from os import * def MakeConstant(value): def GetIt(): return value retutn GetIt STTO = MakeConstant(False) def Test_Control(): UUT_Info()
ptf.py: (This is the Calling or Origination Module)
import TC_Config from pyTC import * TC_Config.Module_Count = 1 def UUT_Info(): if __name__ == "__main__": app = wx.PySimpleApp(0) wx.InitAllImageHandlers() Display = InfoUUT(None, -1, "") Display.Man_Name.SetLabel(" Intellipower, Inc.") Display.ModNumber.SetLabel(" IHT2KGACDC-2184") Display.MilDesig.SetLabel(" ") Display.Nomen.SetLabel(" SWAN-D UPS") Display.PartNo.SetLabel(" ") Display.SerNo.SetLabel(" 2KCAGDCI09390606") app.SetTopWindow(Display) Display.Show() app.MainLoop() Test_Control()
if I call UUT_Info from here (instead of calling Test_Control) it works fine...
When I call from pyTC it errors out as undefined global name...
if I pass it as a function:
But, the idea is that the Standardized Classes for the Test Control and Display will be in pyTC and the Unique Data will be in the ptf.py file...
*AND* UUT_Info is only one of many functions I'll need to call back into ptf.py for.
Quite honestly I am a Python Newbie and I am in way over my head.
Is there anything I can do to accomplish my design goal?
I had thought about passing a dictionary of functions to Test_Control, but, I have no clue as to how to do that...