【发布时间】:2015-11-18 11:15:02
【问题描述】:
我最近开始为由蔡司 ZEN Blue 控制的显微镜编程宏。 Zeiss 宏环境使用 IronPython 2.7.2.1。我需要写出一个 hdf5 文件,但不幸的是,对 IronPython 的 hdf5 支持非常糟糕。
我要传输的数据是 Array[Byte] 类型的,它似乎以某种方式连接到 .NET 的 CLR:
print "length: %i type: %s" %(len(data), type(data))
给予:
length: 4915200 type: <type 'Array[Byte]'>
我可以使用 pickle 通过套接字连接成功地将包含整数和字符串的 dict 传输到 python 服务器(建议 here)。但是,当我尝试 unpickle Array[Byte] 数据时,python 想要导入 CLR,这当然会失败:
ImportError: No module named clr
问题:将 .NET Array[Byte] 转换为未链接到 .NET clr 的基本 python 类型/对象的最佳(最快)方法是什么?
非常感谢, 多米尼克
【问题讨论】:
标签: python clr ironpython pickle