diff --git a/veritar_walk.py b/veritar_walk.py index 96ce6cf9b79cfd25b671eeef5bb1a67264315770..cbee545f42b84aa41286a325bc5c471e71508e73 100644 --- a/veritar_walk.py +++ b/veritar_walk.py @@ -28,8 +28,8 @@ import os import time -BASE = '/home/grub0002/bapcxi/vault/IMBL_2018_Oct_McGillick' -SKIP_TO_DIR = '/home/grub0002/bapcxi/vault/IMBL_2018_Oct_McGillick/output/Iodine_CT/R1820/K1/Scan2_FRC' +BASE = '/home/grub0002/bapcxi/vault/IMBL_May2019_14379' +SKIP_TO_DIR = '/home/grub0002/bapcxi/vault/IMBL_May2019_14379/input' SKIP_FORWARD = False JUST_SHOW_NON_TARS = False @@ -63,15 +63,11 @@ def check_two_files_one_md5(files): def lines_in(filename): - """I'm using this https://stackoverflow.com/a/15074925 - It actually gets it wrong, but I don't care; it's just to get an estimate + """I'm using this https://stackoverflow.com/a/22740334 """ - lines = 0 - buffer = bytearray(2048) with open(filename) as f: - while f.readinto(buffer) > 0: - lines += buffer.count('\n') + lines = sum(line.count('\n') for line in f) return lines