python里的control包_Python controlgraph包_程序模块 - PyPI - Python中文网

控制图

controlgraph是一个有向图,它可以被遍历以支持并行的debian包构建。

从具有有效debian打包的可用目录中,生成一个包含节点的目录(表示源包)和边的构建依赖关系的图。此图的反面可以通过广度优先搜索遍历,以按依赖顺序构建。

controlgraph是以线性或点格式返回要生成的目录的控制图的程序。

安装pip3 install controlgraph

库使用importsysfrompathlibimportPathimportcontrolgraphimportnetworkxasnx# get all directoriesdirs=[pforpinPath.cwd().iterdir()ifp.is_dir()]# get map of local binary packages to locally-available source build dependenciespkgs=controlgraph.parse_all_controlfiles(dirs)# generate build dependency graph from mapdep_graph=controlgraph.graph(pkgs)# print full dot graphnx.nx_pydot.write_dot(dep_graph,sys.stdout)# print linear order from depth-first searchprint(" ".join(list(nx.dfs_postorder_nodes(dep_graph))))

输出strict digraph {

"opx-nas-daemon";

"opx-common-utils";

"opx-cps";

"opx-logging";

"opx-nas-acl";

"opx-sdi-sys";

"opx-nas-daemon" -> "opx-common-utils";

"opx-nas-daemon" -> "opx-cps";

"opx-nas-daemon" -> "opx-logging";

"opx-nas-daemon" -> "opx-nas-acl";

"opx-common-utils" -> "opx-logging";

"opx-cps" -> "opx-common-utils";

"opx-cps" -> "opx-logging";

"opx-nas-acl" -> "opx-common-utils";

"opx-nas-acl" -> "opx-cps";

"opx-nas-acl" -> "opx-logging";

"opx-sdi-sys" -> "opx-common-utils";

"opx-sdi-sys" -> "opx-logging";

}

opx-logging opx-common-utils opx-cps opx-nas-acl opx-nas-daemon opx-sdi-sys

cli用法

当存在一个或多个目录时,运行controlgraph。$ for r in opx-nas-acl opx-nas-daemon opx-alarm opx-logging opx-common-utils;do

git clone "https://github.com/open-switch/$r"done

$ controlgraph

opx-alarm opx-logging opx-common-utils opx-nas-acl opx-nas-daemon

$ controlgraph --graph

strict digraph {"opx-alarm";"opx-nas-daemon";"opx-common-utils";"opx-logging";"opx-nas-acl";"opx-nas-daemon" -> "opx-common-utils";"opx-nas-daemon" -> "opx-logging";"opx-nas-daemon" -> "opx-nas-acl";"opx-common-utils" -> "opx-logging";"opx-nas-acl" -> "opx-common-utils";"opx-nas-acl" -> "opx-logging";}

欢迎加入QQ群-->: 979659372

推荐PyPI第三方库

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您可以通过以下步骤下载和安装cx_Oracle库: 1. 首先,您可以从https://pypi.org/project/cx-Oracle/5.3/#files下载cx_Oracle的适用版本。请确保选择与您的Python版本和操作系统相匹配的文件。比如,如果您使用的是Python 3.6和64位的Windows系统,您可以下载cx_Oracle-5.3-11g.win-amd64-py3.6-2.exe文件。 2. 下载完成后,双击运行下载的安装文件,按照提示进行安装。在安装过程中,您可能需要指定要使用的Python环境。如果您的系统中安装了多个Python版本,请确保选择正确的版本。如果安装后出现问题,可能需要修改您的Python系统PATH。 3. 另外,您还需要安装Oracle客户端。您可以登录https://pypi.org/project/cx-Oracle/#files,下载与您的Python版本和操作系统相匹配的whl文件。比如,如果您使用的是Python 3.6和64位的Windows系统,您可以下载cx_Oracle-8.3.0-cp36-cp36m-win_amd64.whl文件。 4. 下载完成后,将whl文件放置在您希望安装的位置,比如d:\python。 5. 打开命令行窗口,进入到whl文件所在的目录,然后运行以下命令来安装cx_Oracle: ``` pip install cx_Oracle-8.3.0-cp36-cp36m-win_amd64.whl ``` 6. 安装完成后,您可以在Python代码中导入cx_Oracle库,并使用它来连接和操作Oracle数据库。以下是一个连接测试的示例代码: ```python import pandas as pd import cx_Oracle as oracle db = oracle.connect('用户名/密码@主机ip地址/orcl') cursor = db.cursor() sql = 'select * from dual' df = pd.read_sql(sql, con=db) cursor.close() db.close() df.head() ``` 请注意,您需要将用户名、密码和主机IP地址替换为实际的值。这段代码将连接到Oracle数据库,并从dual表中读取数据,并使用pandas库将结果存储在DataFrame中。 #### 引用[.reference_title] - *1* *3* [python中安装cx_Oracle模块](https://blog.csdn.net/weixin_44100044/article/details/126034475)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [windows 下Python或者Spyder离线安装cx_Oracle ](https://blog.csdn.net/u013756405/article/details/125766396)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值