Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #from boxed_msg import *
- import datetime
- from datetime import date, timedelta
- """ Initial way to store the licenses and certifications expiration dates.
- """
- licenses = {
- "New York State Driver License": date(2021,12,11),
- "Security Guard License": date(2020,11,20),
- "Z-89 Fire Life Safety Director": date(2020,5,21),
- "F-85 Fire Safety Director": date(2020,3,7),
- "N-60 Watchperson at Construction Sites": date(2022,2,20),
- "S-14 City Wide Standpipe System": date(2022,2,12),
- "S-12 City Wide Sprinkler Systems": date(2020,6,4)
- }
- sort_lic = {k: v for k, v in sorted(licenses.items(), key=lambda item:item[1])}
- msg = ""
- today = datetime.date.today()
- for license_name, exp_date in sort_lic.items():
- if (exp_date - today) <= timedelta(days=900):
- msg += f"{license_name} exp {exp_date} renew by {exp_date - timedelta(weeks=3)}\n"
- # box_msg(msg=msg, title= "License and Certificate Expiration Date")
- def add_lic(msg):
- lic_name = str(input("Enter the name of the license you want to add: "))
- exp_date = str(input("Enter the expiration date of the license (Y,D,M): "))
- exp_obj = datetime.datetime.strptime(exp_date, '%Y %m %d').date
- add_lic(msg)
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement