Member Avatar
Reusable Code Snippet Turtle random fun (Python)

A little fun with Python's turtle module drawing a number of random stars in the dark sky.

Member Avatar
+2 forum 3
Member Avatar

Just in time for the season, a star. (Playing with my grandson on the Raspberry Pi computer)

Member Avatar
+1 forum 1
Member Avatar
Reusable Code Snippet Light refraction

This is my first try with turtle graphics in Python. It is in fact a sort of "translation" from some old LOGO code. When you run it, this should be the result: ![dbf0a4f76975c5cc4dee5df30139f144](/attachments/small/1/dbf0a4f76975c5cc4dee5df30139f144.png "align-left") Insiders can perhaps play the "Dark side of the moon" record by Pink Floyd :) Any comments (good or bad) on my code are more than welcome.

Member Avatar
+3 forum 8
Member Avatar

How to exit a program but keep the turtle window open? I have tried exit() but it doesn't keep the turtle window open

Member Avatar
+0 forum 3
Member Avatar

I am doing an assignment for university, so I can't exactly post the code. So I will have to explain the best I can. I have to draw 3 stars in a row, 5 points, 6 points, 7 points. We have to do it using a for loop and the goto(....) function. I have managed to draw one star, but if i try to draw another star it will draw it ontop of the previous star. I have a starting point specified as one of the corners of the star using the coordinates of the star found from the angle, …

Member Avatar
+0 forum 2
Member Avatar
Reusable Code Snippet Loop the loop art (Python)

Python module turtle makes it simple to draw graphics art similar to art done by the Logo language.

+1 forum 0
Member Avatar
Reusable Code Snippet Time to think snow (Python)

Using Python module turtle to draw a Koch snow fractal.

Member Avatar
+2 forum 1
Member Avatar

import turtle def f(): turtle.forward(10) def l(): turtle.left(1) def r(): turtle.right(1) def b(): turtle.back(5) turtle.onkey(f,"Up") turtle.onkey(l,"Left") turtle.onkey(r,"Right") turtle.onkey(b,"Down") turtle.showturtle() turtle.listen() while True: print, EDIT: add `turtle.showturtle()` but STILL doesn't work

Member Avatar
+0 forum 4
Member Avatar

hi guys, i was wondering if anyone knew how to make a color wheel in python using turtle. i'v searched all over the web to see examples but haven't had any luck. i am a beginner programmer and it's very confusing to say the least so any explanations would be great! It is a bonus problem for my first programming class and i could sure use the help. here are the directions given: http://prntscr.com/kuqa0 http://prntscr.com/kuqaq and this i what it should look like: http://prntscr.com/kuqbq From the things i did find out how to do are the commands that would come …

Member Avatar
+0 forum 2
Member Avatar

Hello, I'm new and I was wondering how to do these things in python using turtle graphics... but don't know how to do it: 1.Write a program that draws a red line connecting two points (-39,48) and (50, -50) and displays the coordinates of the two points. 2. How to draw a triangle like this in turtle: http://s1263.photobucket.com/albums/ii636/maiden1291/?action=view&current=80390090.jpg 3. Write a program that display the result of 4 X (1-1/3+1/5-1/7+1/9-1/11) and 4 X (1-1/3 + 1/5 -1/7+1/9-1/11+1/13-1/15) please be nice... thanks.

Member Avatar
+0 forum 1
Member Avatar

Can someone please help me "write a drawTree method for the Turtle class" I am given the following information: World w = new World(); Turtle t = newTurtle (320, 480, w); The turtle will begin at the middle of the bottom of the World, facing North. Use the drawRectangle method to draw the trunk of the tree public void drawTree() {

Member Avatar
-1 forum 6
Member Avatar

hi. i am trying to use two turtles in separate windows simultaneously in python but nothing found yet. i have tried multithreadding but still the same. can somebody help me please. thanks.

Member Avatar
+0 forum 5
Member Avatar
Reusable Code Snippet Turtle graphics histogram

I post here the code for histogram using the turtle graphics module, which I posted long time ago in discussion thread. For more special graphs there exist other fancier options, but this tkinter based routine can function in most standard installations of Python. Example data.txt, like mentioned in module docstring: [CODE]Student MarkA MarkB MarkC MarkD MarkF Alex 5 2 1 0 1 Mark 3 5 1 0 0 Costa 7 4 0 0 3 Rita 0 6 2 2 4 Mary 4 2 3 1 0 John 3 4 2 1 0[/CODE]

+0 forum 0
Member Avatar

I can't get this to generate random shapes, etc. Basically what I need to do is randomly generate similar lists consisting of: combinations of 'square', 'triangle', 'circle' and 'left'. And random numbers from 1 to 10 for physical dimensions and 10 to 90 for angles Have the program use 'split' to divide the numbers from the commands so that the turtles can have more variety in their random creations. Any help would be greatly appreciated, I think I've reached a roadblock :p [CODE]import turtle import random import math import time my_screen = turtle.Screen() my_turtle = turtle.Turtle() turtle_commands = ['square 20','circle …

Member Avatar
+0 forum 2

The End.