Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

turtule code for digital clock

from turtle import *
import turtle

scr = turtle.Screen()
 
scr.setup(500, 500)

clock = turtle.Turtle()
 
clock.color('cyan')
 
clock.width(5)
 
 
def drawhourhand():
    clock.penup()
    clock.home()
    clock.right(90)
    clock.pendown()
    clock.forward(100)
 

val = 0
 
for i in range(12):
   
    val += 1
 
    clock.penup()
 
     clock.setheading(-30 * (i + 3) + 75)
 
    clock.forward(22)

    clock.pendown()
 
    clock.forward(15)
 
    clock.penup()
 
    clock.forward(20)
 
    clock.write(str(val), align="center",
              font=("Arial",
                    12, "normal"))
clock.setpos(2, -112)
clock.pendown()
clock.width(2)

clock.fillcolor('Green')
 
clock.begin_fill()
 
clock.circle(7)
 
clock.end_fill()
 
clock.penup()
drawhourhand()
clock.setpos(-18, -62)
clock.pendown()
clock.penup()
 
clock.setpos(-28, -150)
clock.pendown()
clock.write('Python Guides', font=("Arial",14,
                              "normal"))
clock.hideturtle()
turtle.done()
Comment

PREVIOUS NEXT
Code Example
Python :: python does strftime work with date objects 
Python :: get key of min value 
Python :: how to fetch only the columns from a datframe which has a particular datatype 
Python :: get opnly second part of multiindex 
Python :: merge_sort 
Python :: aritmetics to a value in a dict python 
Python :: what exception occurs when you convert a atring to an integer and fail in python 
Python :: clicking items in selenium 
Python :: how to convert hash to string in python 
Python :: [Solved] Pandas TypeError: no numeric data to plot 
Python :: rectangle function numpy 
Python :: python urlopen parameters 
Python :: moviepy not able to read the image file format 
Python :: violin plot seaborn 
Python :: i have installed python modules but pycharm cannot run 
Python :: flask Upload file to local s3 
Python :: update cell in sheet by column name using pandas 
Python :: Matplotlib giving error "OverflowError: In draw_path: Exceeded cell block limit" 
Python :: struct is not defined python 
Python :: python namedtuple typename 
Python :: online python compailer 
Python :: to check weather a dictionary is empty or not in python 
Python :: Python turtle (built in shape) image size 
Python :: geopandas plot fullscreen 
Python :: how to define an empyt dic tin python 
Python :: the code panda 
Python :: pandas dexcribe only one column 
Python :: for in range loop python 
Python :: python check for int 
Python :: python move 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =