You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Python读取未知结构的.cdpg文件?解析数值异常求助

求助:Python解析LabVIEW生成的.cdpg文件失败

我尝试使用Python读取由LabVIEW代码生成的.cdpg文件,但无法获取该文件的结构信息。参考Stack Overflow的一篇帖子编写了代码,虽能运行但解析出的数值毫无意义,不确定是代码存在问题还是对数据的解读有误。

使用的代码如下:

import struct
with open(file, mode='rb') as file: # b is important -> binary
    fileContent = file.read()

ints = struct.unpack("i" * ((len(fileContent) -24) // 4), fileContent[20:-4])
print(ints)

我提供了测试文件cx0000000a.cdpg,恳请各位提供指导。

谢谢,
T


内容的提问来源于stack exchange,提问作者Tanjil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 01:15:30