📄 connect.py
字号:
#!/usr/bin/pythonimport re,syspatt = re.compile("(\d+):((?:[ \t]+\d+)+)")anctotal = 0nontotal = 0count = 0for x in sys.stdin.readlines(): data = patt.search(x) if data!=None: index = int(data.group(1)) if index>110: # highest anchor nodes = [int(x) for x in data.group(2).split(' ') if x!=''] anctotal += len(nodes) nontotal += len([z for z in nodes if z>110]) count +=1.0print "Connectivity (with anchors) = ",anctotal/countprint "Connectivity (without anchors) = ",nontotal/count
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -