当前位置: 首页 > news >正文

网站域名空间多少钱中国菲律宾足球时间

网站域名空间多少钱,中国菲律宾足球时间,网站推广工具工作室,远丰做网站怎么样因为开发需要,我们经常会用C#来写一些库供python调用,但是在使用过程中难免会碰到一些问题,需要我们抽丝剥茧来解决~~~ 首先,我们在python中要想调用C#(基于.net)的dll,需要安装一个库,它就是 pythonnet …

因为开发需要,我们经常会用C#来写一些库供python调用,但是在使用过程中难免会碰到一些问题,需要我们抽丝剥茧来解决~~~

首先,我们在python中要想调用C#(基于.net)的dll,需要安装一个库,它就是

pythonnet

这个安装过程就省略了.... 

然后,在python项目的开头,需要作如下引用:

import clr

那我们就以调用hpy-Library.dll为例,我们先看看是否能载入成功~~

sys.path.append(os.getcwd() + r"\windll")    # hpy-Library.dll 文件所在位置
dll_load = clr.AddReference('hpy-Library')print(dll_load)
print(clr._available_namespaces)
print("hpy_Library in namespaces:", "hpy_Library" in clr._available_namespaces)

如果不出意外的话,将会输出以下内容:

hpy-Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
{'System.IO.Ports', 'Python.Runtime', 'System.Collections.Generic', 'System.CodeDom.Compiler', 'System.Diagnostics.Contracts.Internal', 'System.Xml.Serialization', 'System.Net.WebSockets', 'System.Runtime.InteropServices', 'System.Management', 'System.Runtime.InteropServices.ComTypes', 'System.Net.NetworkInformation', 'System.Configuration.Assemblies', 'System.Security.Policy', 'System.Net.Configuration', 'System.Security.Authentication.ExtendedProtection', 'System.Runtime.ExceptionServices', 'System.Xml.Serialization.Advanced', 'System.Text', 'System.Security.Cryptography', 'System.Xml.Serialization.Configuration', 'System.IO.Compression', 'System.Security.Authentication.ExtendedProtection.Configuration', 'System.Runtime.Versioning', 'System.Runtime.Serialization.Formatters.Binary', 'System.Runtime.Remoting.Channels', 'System.Security', 'System.Runtime.Remoting.Services', 'System.Timers', 'System.Security.AccessControl', 'System.Xml', 'System.ComponentModel.Design.Serialization', 'System.IO', 'System.Net.Mail', 'System.Globalization', 'ClrLoader', 'System.Configuration.Internal', 'System.Collections.Specialized', 'Python', 'Microsoft', 'System.Web', 'System.IO.IsolatedStorage', 'System.IO.MemoryMappedFiles', 'System.Security.Principal', 'Microsoft.Win32', 'System.Windows.Input', 'System.Diagnostics.Eventing', 'System.Net', 'System.Runtime.Remoting', 'System.Linq', 'System.Runtime.Remoting.Metadata.W3cXsd2001', 'System.Security.Permissions', 'System.Runtime.Remoting.Activation', 'System.Diagnostics.Eventing.Reader', 'System.Threading.Tasks', 'System.Net.Cache', 'System.Runtime.Serialization', 'System.Runtime.Remoting.Lifetime', 'hpy_Library', 'System.Runtime.InteropServices.WindowsRuntime', 'System.Runtime.ConstrainedExecution', 'System.Net.Security', 'System', 'System.Linq.Expressions', 'System.Runtime.Remoting.Proxies', 'Microsoft.CSharp', 'System.Security.Cryptography.X509Certificates', 'System.Collections.Concurrent', 'System.CodeDom', 'System.Diagnostics', 'Microsoft.Win32.SafeHandles', 'System.Diagnostics.SymbolStore', 'System.Net.Sockets', 'System.Collections', 'System.Diagnostics.Contracts', 'System.Security.Claims', 'System.ComponentModel.Design', 'System.Security.Authentication', 'System.Xml.XmlConfiguration', 'System.Configuration.Provider', 'System.Windows', 'System.Xml.Schema', 'System.Reflection', 'System.Runtime.DesignerServices', 'System.Deployment', 'System.Threading', 'System.Dynamic', 'System.Runtime.Remoting.Metadata', 'System.IO.Pipes', 'System.Collections.ObjectModel', 'System.Diagnostics.Tracing', 'System.Xml.Xsl', 'System.Windows.Markup', 'System.Runtime.CompilerServices', 'System.Runtime.Remoting.Contexts', 'Python.Runtime.Codecs', 'System.Xml.XPath', 'System.Media', 'Microsoft.VisualBasic', 'System.Management.Instrumentation', 'System.Xml.Resolvers', 'System.Runtime.Remoting.Messaging', 'System.Runtime.Hosting', 'System.ComponentModel', 'System.Text.RegularExpressions', 'System.Runtime.Serialization.Formatters', 'System.Runtime.InteropServices.Expando', 'System.Deployment.Internal', 'System.Runtime', 'System.Net.Mime', 'System.Diagnostics.PerformanceData', 'System.Reflection.Emit', 'System.Resources', 'System.Configuration', 'System.Diagnostics.CodeAnalysis'}
hpy_Library in namespaces: True

第一行表示hpy-Library的版本等相关信息

第二行为clr当前激活的名字空间,这里会包含很多.net库的名字空间

第三行即检查hpy_Library是否在available的namespaces中,结果为真即表示dll载入成功,可用。那么下面你就可以开始使用你的C#外部dll库了~~ ex:

sys.path.append(os.getcwd() + r"\windll")    # hpy-Library.dll 文件所在位置
dll_load = clr.AddReference('hpy-Library')#print(dll_load)
#print(clr._available_namespaces)
#print("hpy_Library in namespaces:", "hpy_Library" in clr._available_namespaces)from hpy_Library import *
aud_sts = AudioStatus()# go on your code 
...

http://www.yayakq.cn/news/575287/

相关文章:

  • 视频网站顶部效果怎么做的网站上传面板
  • 廊坊网站建设策划威海外贸建站
  • 福建省漳州市建设局网站可以申请免费的个人网站吗
  • 建设银行辽宁招聘网站一个域名可以绑定几个网站
  • 建设公司怎么做网站运营重庆点优建设网站公司吗
  • 广州网站开发解决方案如何做网站网页费用
  • 合伙开公司建设网站被骗网站建设罒金手指下拉壹陆
  • 平台网站建设哪家有wordpress应用微信支付
  • php做学校网站免费在线制作表情包工具
  • 跨境电商开店要多少钱seo排名助手
  • 茶叶企业网站建设楚雄州城乡建设局网站
  • 网站如何跟域名绑定东莞网站建设牛魔网a
  • 网站建设综合实训案例晋城市 制作网站
  • 包装设计灵感网站百度权重排名分析
  • 一步一步教你做网站做外贸网站用什么空间
  • 仿做网站可以整站下载器吧网站改成自适应
  • 上海设计网站设计企业网站建设会计分录
  • 赣州网站建设渠道个体营业执照
  • 哈尔滨网站制作哪儿好薇武夷山市建设局网站
  • 招商加盟网站系统Wordpress制作赚钱吗
  • 杭州网站建设faxide建筑工程网络计划图
  • 太原网站制作报价广告影视制作谁家好
  • 没有备案的网站会怎么样广州免费核酸在哪里做
  • 做网站所需要的公司细责及条款wordpress 自定义模型
  • 迁安建设局网站h5调用小程序api
  • 福州设计网站建设百度免费安装
  • 东莞百度网站推广做图片类型网站需要什么服务器
  • 月夜直播在线观看视频免费播放广州网站排名优化开发
  • 17做网店类似网站石景山网站建设的大公司
  • 做淘宝客网站多少钱网页设计模板图片中文