worldclock downloads an image off the www.time.gov server. Worldclock doesn't use a
the sample in case people want to compare the old and new.
The original readme below has not been updated to reflect
the code change.
This is a very simple example that currently only uses two
StaticText widgets and an ImageButton widget. It runs an
calculate the appropriate image which it then downloads
from the www.time.gov server and displays
via the ImageButton. The clock is updated every minute
and the image is updated every five minutes by default.
I'm using an __init__ method and some wxPython code
(wxTimer and EVT_IDLE) directly because that functionality
isn't in PythonCard yet. As the PythonCard prototype
expands in functionality, the wxPython calls will be
This code has been tested on Windows 98 and Windows 2000. I've been
told that if you are running Win98 and Norton Anti-virus, that the
popen call in Python won't work, so beware. Running the script on
*nix requires a number of changes described below.
in xearth.js you must change the line:
var QueryTimeZone = -7;
to match the offset of your own time zone. The USA West coast is -7
the East coast is -4, Sydney, Australia is 10, other time zones
are left as an exercise for the reader ;-)
Eventually xearth.js will go away and be replaced by the
equivalent code in Python, but part of the fun of this
convoluted example is that it calls another program to
do its work.
If you want to run this on *nix you'll have to change the line
jScript = "cscript //nologo xearth.js"
in worldclock.py to the equivalent for running a standalone
also need to change the line in xearth.js
on your *nix box.
Change worldclock_standalone.pyw to worldclock_standalone.py if
you want to see the output, say for debugging purposes.
ps. The original HTML file timezone.html is included so you can see
the scary HTML someone had to write to get a page that looks like
Luckily, I was able to steal the good parts for my own desktop app.