Created
February 11, 2016 14:14
-
-
Save martinbjeldbak/f0435afc3de9ebbec3c3 to your computer and use it in GitHub Desktop.
This file contains 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/python3 | |
import sys | |
input_file = sys.argv[1] | |
with open('output.dot', 'w') as outfile: | |
outfile.write('digraph G {\n') | |
with open(input_file, 'r') as f: | |
for line_num, line in enumerate(f, 1): | |
parent, child = line.strip().split(' ') | |
outfile.write('{} -> {};\n'.format(parent, child)) | |
if line_num > 10000: | |
break | |
outfile.write('}\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment