Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=open("output.txt","w")
- for i in range(1,num_lines+1): #num_lines are the number of lines in the file
- read=linecache.getline('file.txt',i).rstrip('n') #reads line by line from a text file
- splitted=read.split() #splits the string "read"
- for k in range(i+1,num_lines+1):
- read1=linecache.getline('just_nodes.txt',k).rstrip('n')
- splitted1=read1.split()
- alpha_temp=abs(float(splitted[1])-float(splitted1[1])) #heavy step
- alpha=round(alpha_temp,3)
- if (alpha==1.000):
- a.write(str(splitted1[0]) +' '+ str(splitted[0]) + "n")
- a.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement