lv net dll py
v0.1
在Python中訪問.NET DLL(帶有LabView類)
ca_obj = ClientApp1Lib . ClientApp1Lib . ClientApp1 ()
# alas, it calls "new" which triggers file search popup window (known LabVIEW class issue) # so start with a non initialized obj ref and use Create.vi to initialize the LabVIEW class ref
ca_obj = AssemblyLib . ClientApp1Lib . ClientApp1
ca_Type = clr . GetClrType ( AssemblyLib . ClientApp1Lib . ClientApp1 ) # get type
print ( ca_Type . FullName , " t " , ca_Type )
# GetUninitializedObject to avoid constructor and 'new' issue
ca_obj = System . Runtime . Serialization . FormatterServices . GetUninitializedObject ( ca_Type ) print ( ca_obj . IsValid (), " t " , ca_obj ) # False
ca_obj = AssemblyLib . ClientApp1Lib . ClientApp1 . Create ( ca_obj , ca_obj )
print ( ca_obj . IsValid (), " t " , ca_obj ) # True注意:有關vs中構造函數節點問題的更多信息,請參見“新”觸發瀏覽到磁盤上的lvClass文件
clientapp1.dll(我的Interopsembly示例)
consoleapp_ra_e0/program.cs(我的C#console示例)
如何調用動態庫(Pythonnet Wiki)
網絡中的Python如何明確創建CSHARP類的實例(Stackoverflow QA)