简体   繁体   English

如何使用Python读取.mod文件

[英]How to read .mod files using Python

I have a file with extension .mod. 我有一个扩展名为.mod的文件 That file contains fields and data under each field, just like every csv files do. 该文件包含每个字段下的字段和数据,就像每个csv文件一样。 I need to read this .mod file using Python. 我需要使用Python读取此.mod文件。

Please suggest me a way out in Python using Pandas or any other package that could help me with this. 请为我建议使用Pandas或其他任何可以帮助我解决此问题的软件包的Python出路。

Thanks! 谢谢!

On Windows 10, using Python 3.6, I could successfully open the file and read the first line: 在Windows 10上,使用Python 3.6,我可以成功打开文件并读取第一行:

with open('09nested.mod') as f:
    print(f.readlines()[0])

// File: 09nested.mod

>>>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM