Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Tags: Python, Created At: 5/17/2018 4:39:39 PMViews:

HTML view:
Copy Source | Copy HTML
  1. G = gv.digraph('domains');
  2. gv.setv( G, 'size', '10000.00' );
  3. E = gv.protoedge(G);
  4. gv.setv( E, 'arrowsize', '0.5');
  5. N = gv.protonode(G);
  6. gv.setv( N, 'fontsize', '5' );
  7. gv.setv( N, 'shape', 'plaintext' );
  8. for node in nodes.values():
  9.     gv.node( G, node.encode('ascii','ignore') );
  10. for edge in edges:
  11.     gv.edge( G, nodes[edge[ 0]].encode('ascii','ignore'), nodes[edge[1]].encode('ascii','ignore'));
  12. t = time.time();
  13. gv.layout(G, 'fdp');
  14. logging.debug("compute %.4f sec %d Mb" % ((time.time()-t), memory_usage() / 1024) );
  15. gv.render(G, 'png', 'graph.png');

Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2018