#!/usr/bin/env python # # Tom Venken : 19/02/2016 # # Read in index file of sn1 POPC atoms and print out bonds in each POPC # filename = "order.ndx" #read in the file with open(filename) as f: content = f.read().split() i=0 j=0 #loop over file content, skip in case the last carbon is found in sn1 (16C's) for number in content: if j != 15: print content[i],content[i+1] #,i,j i += 1 j += 1 else: j=0 i += 1 # print " %s %s " % (number,number) #for num in range(0,len(content)): # j=num+1 # print " %s %s" % (num,j) #print len(content)