Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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()
Comment

PREVIOUS NEXT
Code Example
Python :: find and flag duplicates pandas 
Python :: example python 
Python :: not want to assign all values of a collection of values in python 
Python :: Return a sorted copy of the list. Does not modify original list. 
Python :: python get all items exept las from array 
Python :: kwargs handling multiple arguments and iterating them loop 
Python :: value counts normalize 
Python :: art library in python spyder 
Python :: all classification algorithim compare 
Python :: how to write a table from 1 to 10 with for loop in fython in 3 lines 
Python :: theta hat symbol python code 
Python :: Find All Occurrences of start indices of the substrings in a String in Python 
Python :: funny application in python 
Python :: join items in set with newline character 
Python :: python loading image file requires absolute path 
Python :: how to set text in QdateEdit pyqt5 
Python :: How to compress image field in django? 
Python :: date format flouytter 
Python :: mu python replicate array n times 
Python :: locate certs path for python 
Python :: delete row by index pandas 
Python :: wait until exe terminates python 
Python :: cannot access modules from neighbouring directories jupyter notebook 
Python :: numpy substract subsequent elements 
Python :: how to subtract two timestamps in python with presence of + and minus in timestamps 
Python :: what is proc file 
Python :: python classmethod property 
Python :: convert html to python 
Python :: hexing floats 
Python :: perceptron multicouche scratch python 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =