Skip to content

Instantly share code, notes, and snippets.

@otykhonruk
Created May 17, 2025 07:50
Show Gist options
  • Save otykhonruk/ad4cff00a2cf154befd33c6090efb464 to your computer and use it in GitHub Desktop.
Save otykhonruk/ad4cff00a2cf154befd33c6090efb464 to your computer and use it in GitHub Desktop.
import sys
if len(sys.argv) != 3:
print('Usage: absent.py all.txt meet.txt')
fn_all, fn_meet = sys.argv[1:]
with open(fn_meet) as meet:
participants = meet.read().splitlines()
with open(fn_all) as all_:
all_ = all_.read().splitlines()
participants_ = ' '.join(a.strip() for a in participants).lower()
for s in all_:
rec = s.split(maxsplit=3) # П І Б частина
surname, *_, unit = rec
if surname.lower() not in participants_:
print(f"{' '.join(rec[:3])}, {unit}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment