【转】K3Cloud IronPython文件调试

1,注册K3Cloud Python插件

 1 clr.AddReference('IronPython')
 2 from IronPython.Hosting import Python
 3 
 4 def wrap_d(f):
 5     func_name = f.__name__
 6     del f
 7 
 8     def wrapper(e):
 9         engine = Python.CreateEngine({'Debug': True})
10         scope = engine.CreateScope()
11         g = globals()
12         for v in ('this',):
13             scope.SetVariable(v, g[v])
14         engine.CreateScriptSourceFromFile(r'F:\K3Cloud\WebSite\APythonBin\test.py').Execute(scope)
15         return getattr(scope, func_name)(e)
16 
17     return wrapper
18 
19 @wrap_d
20 def ButtonClick(e):
21 #    this.View.ShowMessage("22222");
22     pass

2,在对应的目录创建一个Python脚本

3,附加进进程

4,当调用到这个方法的时候就会发现进了方法啦。

 

PS: 我的是VS2012 直接去Github下载PTVS2.1即可。链接:

https://github.com/Microsoft/PTVS/releases?after=v2.2-rc2

  

 转载自金蝶论坛

http://club.kingdee.com/forum.php?mod=viewthread&tid=1007274&extra=&page=2#page

 

posted @ 2018-09-25 18:10  嘿嘿嘿~  阅读(710)  评论(1编辑  收藏  举报