Last active
December 14, 2015 08:29
-
-
Save alghanmi/5058082 to your computer and use it in GitHub Desktop.
Draw GML graph using graph-tool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from graph_tool.all import * | |
| import argparse | |
| """ Parse Commandline Arguments """ | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("file", help="GML file name", type=argparse.FileType('r')) | |
| args = parser.parse_args() | |
| """ Draw Graph """ | |
| g = load_graph(args.file.name) | |
| graph_draw(g) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Add Graph Tool Python Package | |
| echo "# Graph Tool" | tee /etc/apt/sources.list.d/graph-tool.list | |
| echo "deb http://downloads.skewed.de/apt/$(lsb_release -cs) $(lsb_release -cs) universe" | tee -a /etc/apt/sources.list.d/graph-tool.list | |
| echo "deb-src http://downloads.skewed.de/apt/$(lsb_release -cs) $(lsb_release -cs) universe" | tee -a /etc/apt/sources.list.d/graph-tool.list | |
| apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F36FE35D | |
| # Add Boost Backports PPA | |
| add-apt-repository ppa:mapnik/boost | |
| # Update Packages | |
| aptitude update | |
| # Install graph-tool | |
| aptitude install python-graph-tool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment