Horje
Random Hex Colors bar generator, python turtle Code Example
Random Hex Colors bar generator, python turtle
# Random Hex Colors bar generator, python turtle
from turtle import *
import random
from time import sleep

hideturtle()

n = 0
x = -200
y = 200

while True:
      speed(0)
      pensize(20)
      r = format(random.randint(16, 255), "x")
      g = format(random.randint(16, 255), "x")
      b = format(random.randint(16, 255), "x")
      
      ccode = "#"+r+g+b
      print(ccode)
      
      color(ccode)
      up()
      goto(x, y)
      down()
      
      fd(200)
      
      sleep(1)
      if len(ccode) < 7: continue
      y -= 20
      n += 1
      if n == 20: break
      

Screen().exitonclick()




Python

Related
update_or_create django Code Example update_or_create django Code Example
python write to file while reading Code Example python write to file while reading Code Example
presto sequence example date Code Example presto sequence example date Code Example
how to schedule python script in windows Code Example how to schedule python script in windows Code Example
grouped box plot in python Code Example grouped box plot in python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7