diff options
author | Thomas White <taw@physics.org> | 2017-07-06 17:22:11 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2017-07-06 17:24:59 +0200 |
commit | 5292f57d4434c7267e8d945871513d742ff42427 (patch) | |
tree | d460aa5cef5a501516876850ef243cfc27313d5a /scripts/find-pairs | |
parent | 48d4a6b8e82cce81222ec58fdfb488ed79ce0bcf (diff) | |
parent | dc3395900fc3ce0d3961757628ff83ad6456be19 (diff) |
Merge branch 'master' into taketwo
Diffstat (limited to 'scripts/find-pairs')
-rwxr-xr-x | scripts/find-pairs | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/scripts/find-pairs b/scripts/find-pairs index 4629767d..8c3b69d0 100755 --- a/scripts/find-pairs +++ b/scripts/find-pairs @@ -1,14 +1,13 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- - # # Find pairs of observations from the same pattern # -# Copyright © 2014 Deutsches Elektronen-Synchrotron DESY, -# a research centre of the Helmholtz Association. +# Copyright © 2014-2017 Deutsches Elektronen-Synchrotron DESY, +# a research centre of the Helmholtz Association. # # Author: -# 2014 Thomas White <taw@physics.org> +# 2014-2017 Thomas White <taw@physics.org> # import re as regexp @@ -41,33 +40,33 @@ def find_405(f): f = open(fn1, 'r') flines = find_405(f) -print len(flines),"measurements in",fn1 +print("{} measurements in {}".format(len(flines),fn1)) g = open(fn2, 'r') glines = find_405(g) -print len(glines),"measurements in",fn2 +print("{} measurements in {}".format(len(glines),fn2)) -print "\nThe common measurements:\n" +print("\nThe common measurements:\n") for fn in flines.keys(): if fn in glines: - print fn - print flines[fn].rstrip("\r\n") - print glines[fn] - print + print(fn) + print(flines[fn].rstrip("\r\n")) + print(glines[fn]) + print() del flines[fn] del glines[fn] -print "\nThe measurements only in",fn1,":\n" +print("\nThe measurements only in {}:\n".format(fn1)) for fn in flines.keys(): - print fn - print flines[fn].rstrip("\r\n") - print + print(fn) + print(flines[fn].rstrip("\r\n")) + print() -print "\nThe measurements only in",fn2,":\n" +print("\nThe measurements only in {}:\n".format(fn2)) for fn in glines.keys(): - print fn - print glines[fn].rstrip("\r\n") - print + print(fn) + print(glines[fn].rstrip("\r\n")) + print("") |