mainloop(pyclockan analog/digital clock widget one of the first things always look for when exploring new computer interface is clock because spend so much time glued to computersit' essentially impossible for me to keep track of the time unless it is right there on the screen in front of me (and even thenit' iffythe next programpyclockimplements such clock widget in python it' not substantially different from the clock programs that you may be used to seeing on the window system because it is coded in pythonthoughthis one is both easily customized and fully portable among windowsthe window systemand macslike all the code in this in addition to advanced gui techniquesthis example demonstrates python math and time module tools quick geometry lesson before show you pyclockthoughlet me provide little background and confession quick--how do you plot points on circlethisalong with time formats and eventsturns out to be core concept in clock widget programs to draw an analog clock face on canvas widgetyou essentially need to be able to sketch circle--the clock face itself is composed of points on circleand the secondminuteand hour hands of the clock are really just lines from circle' center out to point on the circle digital clocks are simpler to drawbut not much to look at now the confessionwhen started writing pyclocki couldn' answer the last paragraph' opening question had utterly forgotten the math needed to sketch out points on circle (as had most of the professional software developers queried about this magic formulait happens after going unused for few decadessuch knowledge tends to be garbage collected finally was able to dust off few neurons long enough to code the plotting math neededbut it wasn' my finest intellectual hour +if you are in the same boati don' have space to teach geometry in depth herebut can show you one way to code the point-plotting formulas in python in simple terms before tackling the more complex task of implementing clocki wrote the plotter gui script shown in example - to focus on just the circle-plotting logic its point function is where the circle logic lives--it plots the ( ,ycoordinates of point on the circlegiven the relative point numberthe total number of points to be placed on the circleand the circle' radius (the distance from the circle' center to the points drawn upon itit first calculates the point' angle from the top by dividing by the +lest that make software engineers seem too doltishi should also note that have been called on repeatedly to teach python programming to physicistsall of whom had mathematical training well in advance of my ownand many of whom were still happily abusing fortran common blocks and go-tos specialization in modern society can make novices of us all pyclockan analog/digital clock widget