Question: This is my Clock class set methods. def increaseDay ( self ) : if self.day < self.months [ self . month - 1 ] :
This is my Clock class set methods.
def increaseDayself:
if self.day self.monthsselfmonth :
self.day
else:
self.day
if self.month :
self.month
else:
self.month
self.year
if self.leapyearselfyear:
self.months
else:
self.months
def decreaseDayself:
if self.day :
self.day
else:
if self.month :
self.month
self.day self.monthsselfmonth
else:
self.year
self.month
self.day
def increaseSecondself:
self.sec
if self.sec :
self.sec
self.min
if self.min :
self.min
self.hr
if self.hr :
self.hr
self.increaseDay
def decreaseSecondself:
self.sec
if self.sec :
self.sec
self.min
if self.min :
self.min
self.hr
if self.hr :
self.hr
self.decreaseDay
This below code needs to be inherited from Clock class
import tkinter as tk
from datetime import datetime
class Clock:
def initself:
self.time datetime.now
def strself:
return self.time.strftimemdY I:M:S p
def setclockself month, day, year, hour, minute, second:
try:
self.time datetimeyear month, day, hour, minute, second
return True
except ValueError:
return False
def increasedayself:
self.time timedeltadays
def decreasedayself:
self.time timedeltadays
def increasesecondself:
self.time timedeltaseconds
def decreasesecondself:
self.time timedeltaseconds
def settime:
try:
selectedtime datetimeintyearlist.gettkACTIVE months.indexmonthlist.gettkACTIVE intdaylist.gettkACTIVE
inthourlist.gettkACTIVE intminutelist.gettkACTIVE intsecondlist.gettkACTIVE
if clock.setclockselectedtime.month, selectedtime.day, selectedtime.year,
selectedtime.hour, selectedtime.minute, selectedtime.second:
timelabel.configtextclock.str
else:
timelabel.configtext
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
