Created
October 6, 2012 20:11
-
-
Save fritz0705/3845965 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env python3 | |
| # coding: utf-8 | |
| import sys | |
| peerings = [] | |
| print("graph dn42 {") | |
| for line in sys.stdin: | |
| _as = line.split(" ")[:-1] | |
| i = 0 | |
| while i < len(_as) - 1: | |
| if _as[i] != _as[i+1] and (_as[i], _as[i+1]) not in peerings: | |
| peerings.append((_as[i], _as[i+1])) | |
| print("{0} -- {1};".format(_as[i], _as[i+1])) | |
| i += 1 | |
| print("}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment