Jan-05-2023, 12:40 PM
Jan-06-2023, 05:01 PM
If you look at your screenshot, you'll see that the error relates to line 92 in your code, but we can't see line 92, so how are we to help?
That said, it's already been pointed out that a screenshot is not the way to present this.
That said, it's already been pointed out that a screenshot is not the way to present this.
Jan-06-2023, 06:57 PM
Please post code, not screenshots. If there is an error, post the entire error message, including the entire traceback. Make sure to post the code referenced in the error message.
Your error is on line 92 in your program. There is a datetime.strptime(data_string, format) call where the data_str is does not follow the specified format in the "format" variable ("%H:%M:%S"). At a minimum data_str contains a ')' that is not part of the format. There could be more mismatches.
A few comments on the code you did share with us:
Your error is on line 92 in your program. There is a datetime.strptime(data_string, format) call where the data_str is does not follow the specified format in the "format" variable ("%H:%M:%S"). At a minimum data_str contains a ')' that is not part of the format. There could be more mismatches.
A few comments on the code you did share with us:
from datetime import datetime from time import time # do this now = datetime.now() dt_str = now.strftime('%Y-%m-%d %H-%M-%S') filename = f'Attendance/Attendance {dt_str}' # not this now = time() dt = datetime.fromtimestamp(now) date_str = dt.strftime("%Y-%m-%d") time_str = dt.strftime("%H:%M:%S") h, m, s = time_str.split(':') filename = f'Attendance/Attendance {date_str} {h}-{m}-{s}'