Created
October 17, 2020 11:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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