如何在Python脚本中导入和使用csvkit [英] How to import and use csvkit in a Python script

查看:410
本文介绍了如何在Python脚本中导入和使用csvkit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得这是一个愚蠢的问题。我找到了一个我需要使用的Python库。特别是 csvkit 。我需要在我创建的现有应用程序中使用它。但是,我已经能够看到的所有示例用法是从命令行参数传递像这样:

I feel like this is a silly question. I've found a python library I need to use. Specifically csvkit . I need to use this in an existing application I've created. However, all of the example usage I've been able to see is from the command line where arguments are passed like this:

in2csv ne_1033_data.xlsx > data.csv

我能够导入这个并在我的应用程序中使用它吗?来自csvkit import in2csv
in2csv(ne_1033_data.xlsx,data.csv)$ b的行:

Would I be able to import this and use it within my application? Something along the lines of:

from csvkit import in2csv
in2csv(ne_1033_data.xlsx, data.csv)

感谢您帮助我。我相信我误解了一些东西...

Thanks for helping me out. I'm sure I'm misunderstanding something...

推荐答案

引用 csvkit手册

import csvkit

正在寻找。

导入后,我假设命令语法和数据流与 python csv 模块。同样,这是基于csvkit手册。

After importing, I'm assuming that the command syntax and data flow are similar to that of the python csv module. Again this is based on the csvkit manual.

这篇关于如何在Python脚本中导入和使用csvkit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆