-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain2.py
112 lines (100 loc) · 3.27 KB
/
main2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import os
def get_present_students_from_file(input_file_path):
with open(input_file_path, 'r') as file:
present_students_string = file.read().casefold()
return present_students_string
def evaluate_attendance(present_students_string):
attendance = {
"parijat singh kubrey": " ",
"harsh vardhan": " ",
"sushil singh": " ",
"vivek kulaste": " ",
"abhinav pandey": " ",
"adya trisal": " ",
"aishwarya agrawal": " ",
"akshat karodiya": " ",
"alinoor multani": " ",
"aman nagle": " ",
"anurag griyam": " ",
"ashutosh singh": " ",
"ashutosh verma": " ",
"ashvita patidar": " ",
"ayush kotwalla": " ",
"deep kothari": " ",
"deepam gupta": " ",
"dev kumar": " ",
"digvijay verma": " ",
"divya lakhotia": " ",
"eeshwari bhatore": " ",
"gurucharan purte": " ",
"harish bhabhar": " ",
"harish parmar": " ",
"harshita bhomadiya": " ",
"ishita jain": " ",
"jasman jatav": " ",
"jatin gupta": " ",
"krishna lohare": " ",
"lokendra mandloi": " ",
"madhusudan yadav": " ",
"manish jhamele": " ",
"neha dawar": " ",
"nilay ostwal": " ",
"niti mangwani": " ",
"parth arora": " ",
"pradyumna upadhyay": " ",
"pratibha chouhan": " ",
"pratik mehta": " ",
"priyansh tiwari": " ",
"rahul waskale": " ",
"rajat karahe": " ",
"raksha astare": " ",
"raman dhakar": " ",
"rashi malviya": " ",
"rishav thakur": " ",
"rithik pandita": " ",
"rudransh choudhary": " ",
"sagar choubey": " ",
"samyak jain": " ",
"sarthak joshi": " ",
"sarthak neema": " ",
"satyam patel": " ",
"sheetal kothe": " ",
"siddhant jain": " ",
"sonu gupta": " ",
"sumit kr singh": " ",
"tashi agrawal": " ",
"unnati dixit": " ",
"vanshika sundrani": " ",
"vicky nigam": " ",
"yash soni": " ",
"yogesh singh": " ",
"kishan joshi": " ",
"jainisha khowal": " ",
"akanksha dubey": " ",
"ashutosh barde": " ",
"ayush karma": " ",
"bhoomika pandey": " ",
"disha khare": " ",
"kamini singh chauhan": " ",
"prashant arjariya": " ",
"prateek onkar": " ",
"rajni yadav": " ",
"ravindra kumar kushwaha": " ",
"sakshi chaurasiya": " ",
"vipul porwal": " ",
}
for student in attendance.keys():
if present_students_string.find(student) != -1:
attendance[student] = "P"
return list(attendance.values())
def print_attendance_to_file(output_file_path, attendance_list):
f = open(output_file_path, 'w')
f.write('\n'.join(attendance_list))
f.close()
if __name__ == '__main__':
cur_dir = os.getcwd()
input_file_path = os.path.join(cur_dir, "input.csv")
output_file_path = os.path.join(cur_dir, "output.csv")
present_students_string = get_present_students_from_file(input_file_path)
attendance_list = evaluate_attendance(present_students_string)
print_attendance_to_file(output_file_path, attendance_list)