Skip to content

Instantly share code, notes, and snippets.

@akshayrdeodhar
Created October 17, 2020 11:56
Show Gist options
  • Save akshayrdeodhar/467b955dc77b71e6ddc0b9bf09c8acac to your computer and use it in GitHub Desktop.
Save akshayrdeodhar/467b955dc77b71e6ddc0b9bf09c8acac to your computer and use it in GitHub Desktop.
Way to find out people who have not attended a microsoft teams session given a list of their usernames, and the CSV generated by Teams
import pandas as pd
from sys import argv
if __name__ == "__main__":
n = len(argv)
if n != 2:
print("usage: python3 attendance.py <name_of_file>")
exit(1)
set_of_all = set()
b1 = set()
with open("all_students.txt", "r") as fp:
for line in fp:
set_of_all.add(line.rstrip())
for x in set_of_all:
print(x)
what = input()
if what.rstrip() == "Y":
b1.add(x)
with open('batch.txt', 'w') as fo:
for x in b1:
print(x, file = fo)
from sys import argv
if __name__ == "__main__":
n = len(argv)
if n != 3:
print("usage: python3 attendance.py <batch_file> <name_of_file>")
exit(1)
__, batch, attendance = argv
set_of_all = set()
with open(batch, "r") as fp:
for line in fp:
set_of_all.add(line.rstrip())
attendance_data = pd.read_csv(attendance, encoding = 'utf-16', delimiter = '\t')
todays_attendees = set(sorted(list(attendance_data['Full Name'])))
absent = set_of_all - todays_attendees
print(sorted(list(absent)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment