~ubuntu-branches/ubuntu/utopic/python-networkx/utopic

« back to all changes in this revision

Viewing changes to scripts/adjlist2edgelist.py

  • Committer: Package Import Robot
  • Author(s): Sandro Tosi
  • Date: 2012-08-11 12:41:30 UTC
  • mfrom: (1.4.1) (5.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120811124130-whr6uso7fncyg8bi
Tags: 1.7-1
* New upstream release
* debian/patches/changeset_*
  - removed, included upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# convert adjacency list to edge list
3
 
import fileinput
4
 
from string import split
5
 
 
6
 
for line in fileinput.input():
7
 
    if line.startswith("#"):
8
 
        continue
9
 
    v=split(line)
10
 
    source=v.pop(0)
11
 
    for target in v:
12
 
        print source,target
13
 
 
14
 
        
15