Note - Double Click to Copy Code Contact Us!
Posts

Automatic attendance using Python

Tech Doubility
Automatic attendance using Python



  1. import csv
  2. from datetime import date
  3.  
  4. def mark_attendance(student_id):
  5. today = date.today().strftime("%Y-%m-%d")
  6. with open('attendance.csv', 'a', newline='') as csvfile:
  7. writer = csv.writer(csvfile)
  8. writer.writerow([today, student_id])
  9.  
  10. def main():
  11. student_id = input("Enter student ID: ")
  12. mark_attendance(student_id)
  13. print("Attendance marked successfully.")
  14.  
  15. if __name__ == '__main__':
  16. main()

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.