python调用gephi_pycallgraph是一个Python模块能够生成Python程序的调用图

Python Call Graph

Welcome! Python Call Graph is a Python module that creates call graph visualizations for Python applications.

Screenshots

Click on the images below to see a larger version and the source code that generated them.

Project Status

The latest version is 1.0.1 which was released on 2013-09-17, and is a backwards incompatible from the previous release.

The documentation needs some work stiil. Feel free to contribute :)

Features

Support for Python 2.7+ and Python 3.3+.

Static visualizations of the call graph using various tools such as Graphviz and Gephi.

Execute pycallgraph from the command line or import it in your code.

Customisable colors. You can programatically set the colors based on number of calls, time taken, memory usage, etc.

Modules can be visually grouped together.

Easily extendable to create your own output formats.

Quick Start

Installation is easy as:

pip install pycallgraph

You can either use the command-line interface for a quick visualization of your Python script, or the pycallgraph module for more fine-grained settings.

The following examples specify graphviz as the outputter, so it's required to be installed. They will generate a file called pycallgraph.png.

The command-line method of running pycallgraph is:

$ pycallgraph graphviz -- ./mypythonscript.py

A simple use of the API is:

from pycallgraph import PyCallGraph

from pycallgraph.output import GraphvizOutput

with PyCallGraph(output=GraphvizOutput()):

code_to_profile()

Documentation

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值