Commit 41fb76fd authored by Gary Ruben's avatar Gary Ruben
Browse files

changed the way lines_in() works

parent a2515cea
......@@ -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'
......@@ -63,15 +63,11 @@ def check_two_files_one_md5(files):
def lines_in(filename):
"""I'm using this
It actually gets it wrong, but I don't care; it's just to get an estimate
"""I'm using this
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment