Skip to content

Instantly share code, notes, and snippets.

@pythonizame
Last active January 19, 2019 11:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pythonizame/3611d320cb3bbe47cc89 to your computer and use it in GitHub Desktop.
Save pythonizame/3611d320cb3bbe47cc89 to your computer and use it in GitHub Desktop.
# coding=utf-8
__author__ = 'gaspar'
from turtle import *
import turtle
setup(1024,900) #configura el tamaño de la ventana
def dibuja_rombo(velocidad):
turtle.speed(velocidad)
turtle.pensize(5)
turtle.penup()
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(25)
turtle.pencolor("blue")
turtle.right(180)
turtle.pendown()
turtle.left(40)
for i in range(3):
turtle.forward(200)
turtle.left(90)
turtle.forward(200)
turtle.left(135)
turtle.forward(277)
turtle.penup()
turtle.backward(300)
turtle.write("Pythonizame")
turtle.hideturtle()
def dibuja_python(velocidad):
pl = turtle.Turtle()
pl.speed(velocidad)
pl.pensize(5)
pl.fillcolor("gray")
pl.penup()
pl.left(90)
pl.forward(110)
pl.right(90)
pl.forward(20)
pl.pendown()
pl.begin_fill()
pl.backward(75)
pl.right(90)
pl.forward(50)
pl.left(90)
pl.forward(50)
pl.backward(100)
pl.right(90)
pl.forward(50)
pl.left(90)
pl.forward(50)
pl.left(90)
pl.forward(25)
pl.right(90)
pl.forward(75)
pl.left(90)
pl.forward(75)
pl.end_fill()
# segundo python
pl.fillcolor("gray")
pl.begin_fill()
pl.backward(50)
pl.right(90)
pl.forward(50)
pl.right(90)
pl.forward(50)
pl.right(90)
pl.forward(100)
pl.backward(50)
pl.left(90)
pl.forward(50)
pl.right(90)
pl.forward(75)
pl.right(90)
pl.forward(75)
pl.right(90)
pl.forward(75)
pl.left(90)
pl.forward(50)
pl.end_fill()
pl.left(90)
pl.penup()
pl.forward(50)
pl.pendown()
pl.dot(10,"white")
pl.penup()
pl.left(90)
pl.forward(100)
pl.left(90)
pl.forward(30)
pl.pendown()
pl.dot(10,"white")
pl.hideturtle()
dibuja_rombo(5)
dibuja_python(5)
turtle.exitonclick() #permite que la ventana se cierre al hacer clic dentro
@gaspardzul
Copy link

Resultado:
captura de pantalla 2015-08-11 a las 14 46 37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment