Thursday, March 16, 2023

Python - Pride and Transgender Flag

Python - Pride and Transgender Flag


The fact that we don't have equality and there are elected officials whose agenda is to destroy civil rights on this planet is ridiculous.  Enough is enough. 


I stand with the LGTBQ community.  Now and forever.   - EWS



Python Code Using Casio MicroPython






Download here:  https://drive.google.com/file/d/1ZSGR_ayEOIwbjsEiNtINCmIhbs7yo0zt/view?usp=share_link


Pride Flag:  pride50.py


# pride flag


from casioplot import *


clear_screen()


for i in range(5,376):

  for k in range(5,35):

    set_pixel(i,k,(228,3,3))


for i in range(5,376):

  for k in range(35,65):

    set_pixel(i,k,(255,140,0))


for i in range(5,376):

  for k in range(65,95):

    set_pixel(i,k,(255,237,0))


for i in range(5,376):

  for k in range(95,125):

    set_pixel(i,k,(0,128,38))


for i in range(5,376):

  for k in range(125,155):

    set_pixel(i,k,(36,64,142))


for i in range(5,376):

  for k in range(155,185):

    set_pixel(i,k,(115,41,130))



show_screen()    


Transgender Flag:  trans50.py


# transgender flag


from casioplot import *


clear_screen()


for i in range(5,376):

  for k in range(5,41):

    set_pixel(i,k,(91,206,250))


for i in range(5,376):

  for k in range(41,77):

    set_pixel(i,k,(245,169,184))


for i in range(5,376):

  for k in range(77,113):

    set_pixel(i,k,(255,255,255))


for i in range(5,376):

  for k in range(113,149):

    set_pixel(i,k,(245,169,184))


for i in range(5,376):

  for k in range(149,185):

    set_pixel(i,k,(91,206,250))


show_screen()    




Python Code Using the Turtle Module from Numworks






Download here:  https://drive.google.com/file/d/1odztGLGfyRsVwq5xSBrfIrc27pj7v58i/view?usp=share_link


Pride Flag:  pride50.nw


from math import *

from turtle import *


hideturtle()

speed(10)


# have to keep size to 1

# want box quality


color(228,3,3)

for i in range(90,60,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(255,140,0)

for i in range(60,30,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(255,237,0)

for i in range(30,0,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)

  

color(0,128,38)

for i in range(0,-30,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(36,64,142)

for i in range(-30,-60,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(115,41,130)

for i in range(-60,-90,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)



Transgender Flag:  transnw.py


from math import *

from turtle import *


hideturtle()

speed(10)


# have to keep size to 1

# want box quality


color(91,206,250)

for i in range(90,54,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(245,169,184)

for i in range(54,18,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(255,255,255)

for i in range(18,-18,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(245,169,184)

for i in range(-18,-54,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(91,206,250)

for i in range(-54,-90,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)


color(91,206,250)

for i in range(90,54,-1):

  penup()

  goto(-140,i)

  pendown()

  forward(280)



Source:


"Pride (Rainbow) Flag Color Codes"  flagcolorcodes Retrieved March 15, 2023.

https://www.flagcolorcodes.com/pride-rainbow


"Transgender Flag Color Codes"   flagcolorcodes.  Retrieved March 15, 2023. 

https://www.flagcolorcodes.com/transgender



Eddie 



All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.