Pipfile的解析器(获取Pipfile中使用的所有软件包的列表) [英] Parser for Pipfiles (get a list of all packages used in a Pipfile)

查看:130
本文介绍了Pipfile的解析器(获取Pipfile中使用的所有软件包的列表)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有解析器可以读取Pipfile并返回Pipfile中使用的所有软件包的列表?

Is there any parser out there for reading in a Pipfile and returning a list of all packages used in the Pipfile?

如果没有,那该怎么办?我当时以为正则表达式可以完成这项工作,但是我对Pipfiles的结构不够了解,无法确定是这种情况.

If not, how would one go about this? I was thinking a regular expression could do the job, but I am not sufficiently acquainted with the structure of Pipfiles to confirm that is the case.

推荐答案

首先安装pipfile pip install pipfile.

first install pipfile pip install pipfile.

然后只使用它提供的解析器

then just use the parser it provides

from pipfile import  Pipfile
parsed = Pipfile.load(filename=pipfile_path)

这篇关于Pipfile的解析器(获取Pipfile中使用的所有软件包的列表)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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