Jump to content

In one of my computer classes the teacher has provided a template for the class to use to make a working analog clock in python using turtles. I honestly don't know where to start. I know how to get the clock drawn out, but I can't figure out how to make the minute, hour, and second hand while having them update in real time. Any help would be appreciated.

clock_shell.py

Link to comment
https://linustechtips.com/topic/663965-anyone-any-good-with-python/
Share on other sites

Link to post
Share on other sites

I don't know Python, but I would imagine you use anything in here:

https://docs.python.org/2/library/time.html

 

And with the turtles.. I think you mean pictures of turtles with numbers on them? just gotta take apart the clock numbers and place down the turtle pictures.

If you embed the code in your post (using the code module, next to the spoiler eye button in the editing module above) I could take a look at it.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to post
Share on other sites

24 minutes ago, Minibois said:

I don't know Python, but I would imagine you use anything in here:

https://docs.python.org/2/library/time.html

 

And with the turtles.. I think you mean pictures of turtles with numbers on them? just gotta take apart the clock numbers and place down the turtle pictures.

If you embed the code in your post (using the code module, next to the spoiler eye button in the editing module above) I could take a look at it.

No they mean this turtle

Link to post
Share on other sites

you will need an infinite loop. I suggest having hours, minutes and seconds.

 

use import time and sleep(1) to make it sleep at the end for a second. Then add one to second.

 

you will then need if statements so of

second == 60

minutes += 1

second == 0

 

lastly check tht when it gets to 12 to reset it all.

 

now for your problem you will need to move the turtle on each second, min and hour.

 

I hope I explained that ok, I'm on my phone just now so can't actually code you anything.

 

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×