-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemployeeattendancetracker.py
More file actions
39 lines (38 loc) · 1001 Bytes
/
employeeattendancetracker.py
File metadata and controls
39 lines (38 loc) · 1001 Bytes
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
def choice():
ch=input("type 'enter' to enter record and 'read' toread previous record ")
if ch =="enter":
record()
elif ch=="read":
read()
else:
print("exit")
def record():
import csv
f=open('s.csv', 'w',newline='')
writer=csv.writer(f)
writer.writerow(['empployee id','timetimestamp','status'])
rec=[]
while True:
print('enter employee records')
r=int(input('enter employee id'))
n=input("enter date (yyyy-mm-dd)-")
t=input("enter time (hh:mm)-")
m=input('enter employee status')
emprec=[r,(n,t),m]
print("employee:",emprec)
rec.append (emprec)
ch=input('do you want to continue')
if ch=='n' :
break
for i in rec:
writer.writerow(i)
f.close()
choice()
def read():
import csv
f=open('s.csv','r')
r=csv.reader(f)
for row in r:
print(row)
f.close()
choice()