testHost4Dbg.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:remoteControlPPT 作者: htwenning 项目源码 文件源码
def TestEngine():
  model = {'Test' : util.wrap(ObjectModel()) }
  scriptDir = "."
  site = MySite(model)
  pyEngine = site._AddEngine("Python")
#  pyEngine2 = site._AddEngine("Python")
  vbEngine = site._AddEngine("VBScript")
#  forthEngine = site._AddEngine("ForthScript")
  try:
#    code = open(os.path.join(scriptDir, "debugTest.4ths"),"rb").read()
#    forthEngine.AddCode(code)
    code = open(os.path.join(scriptDir, "debugTest.pys"),"rb").read()
    pyEngine.AddCode(code)
    code = open(os.path.join(scriptDir, "debugTest.vbs"),"rb").read()
    vbEngine.AddCode(code)
#    code = open(os.path.join(scriptDir, "debugTestFail.pys"),"rb").read()
#    pyEngine2.AddCode(code)

#    from win32com.axdebug import axdebug
#    sessionProvider=pythoncom.CoCreateInstance(axdebug.CLSID_DefaultDebugSessionProvider,None,pythoncom.CLSCTX_ALL, axdebug.IID_IDebugSessionProvider)
#    sessionProvider.StartDebugSession(None)

    raw_input("Press enter to continue")
 #   forthEngine.Start()
    pyEngine.Start() # Actually run the Python code
    vbEngine.Start() # Actually run the VB code
  except pythoncom.com_error, details:
    print "Script failed: %s (0x%x)" % (details[1], details[0])
  # Now run the code expected to fail!
#  try:
#    pyEngine2.Start() # Actually run the Python code that fails!
#    print "Script code worked when it should have failed."
#  except pythoncom.com_error:
#    pass

  site._Close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号