Questions tagged [zelle-graphics]

A simple object oriented graphics library for Python under the GPL license. The library is intended for novice programmers and teaching purposes and features basic geometric objects such as lines, circles or polygons. Use this tag for specific programming questions about creating graphics with the Zelle-graphics library.

Zelle-graphics is a simple object oriented graphics library designed to make it very easy for novice programmers to experiment with computer graphics in an object oriented fashion. It was written by John M. Zelle for use with the book Python Programming: An Introduction to Computer Science Third Edition (Python 3.x) — Franklin, Beedle & Associates 2016-Aug-08)

The library provides the following graphical objects:
  Point
  Line
  Circle
  Oval
  Rectangle
  Polygon
  Text
  Entry (for text-based input)
  Image

The most recent version of the library can be obtained at:

http://mcsp.wartburg.edu/zelle/python

177 questions
0
votes
2 answers

Get circle to orbit with given equations using Python graphics.py module

I was given this equation in order to get the circle to orbit. I created an infinite loop assuming it should orbit forever. x = cx + r*cos(t) and y = cy + r*sin(t) Am I doing something wrong? from graphics import * import math def main(): …
0
votes
1 answer

Applying the getMouse() function to one part of the window

I am attempting to apply the getMouse() function to a specific part of the window, instead of the whole thing. I need the block that is clicked in to change color if it is 'rect1'. However if any other block is clicked, nothing should happen. I have…
Manaar
  • 202
  • 4
  • 15
0
votes
1 answer

Python: Counting and printing mouse clicks (Zelle's Graphics)

I am trying to figure out how to count how many times the mouse is clicked in the window in order to set a limit on the amount. What I am making is a game where a invisible circle must be found and I want the different difficulties to affect how…
0
votes
0 answers

Displaying images in python using functions and drawing them

def dice1(): dice1 = Image(Point(50, 100),'one.gif') return dice1 def dice2(): dice2 = Image(Point(50,100),'two.gif') return dice2 def dice3(): dice3 = Image(Point(50,100),'three.gif') return dice3 def dice4(): dice4 =…
NDIrishman23
  • 33
  • 1
  • 9
0
votes
2 answers

python zelle graphics checkMouse()?

yes_box = Rectangle(Point(200, 150),Point(350,50)) yes_box.setOutline('blue') yes_box.setWidth(1) yes_box.draw(graphics_win) def mouse_check(arg1): ?????? Hey, have a quick question that is probably really obvious, but has me really…
NDIrishman23
  • 33
  • 1
  • 9
0
votes
1 answer

Can getMouse act on one specific object in Python?

I am trying to make a Tic Tac Toe game in Python using the Zellegraphics module. I want to use getMouse for mouse input but I am unable to figure out how to make getMouse to work on one cell of the board. I defined 9 different squares and what I…
user1946564
  • 47
  • 1
  • 6
0
votes
3 answers

Remove a line from the window in Python Zelle Graphics

I have some code below that draws lines on a circle but the lines aren't deleted during each iteration. Does anyone know how to delete object from the window? I tried win.delete(l) but it didn't work. Thanks. import graphics import…
JupiterOrange
  • 339
  • 2
  • 6
  • 18
-1
votes
1 answer

Patchwork style and color arrangement

I have to do a patchwork and I need a particular colour and style arrangement. Right now I have this: [ My code: from graphics import * colour = ["","",""] def main(): size= getSize() colour = getColour() win = GraphWin("Patchwork",…
-1
votes
1 answer

How to undraw() shapes that've already been drawn in Zelle Graphics

I've started learning Python (Zelle Graphics) and I'm trying to make a slot machine. Using a function that I've defined in advance, I've managed to draw the shapes into the slot machine in while loop. I need to reset (undraw()) them when the user…
-1
votes
1 answer

How to draw this IFS cantor set with labels?

I am using the Zelle graphics package in Python to draw the iterations of a cantor ternary like IFS (iterated function system) graph. The iterated function system I want to draw is: {R;x/9+1/6,2/3+x/9,x/9+1/3,x/9+5/6} The following code is an…
Praveen
  • 139
  • 1
  • 10
-1
votes
1 answer

How to create a function for my conversions

These are the instructions for my project. Define different functions for the conversions. Call these functions. I have created my window with the entry box and text boxes. I have a function but I know I should use setText() to display the…
pangie
  • 3
  • 3
-1
votes
1 answer

I cannot find a way to create a correct "turtle" pattern, as my code only draws a square

The task is to do what a turtle library would do but without the library. This is the drawing that I obtain It needs to do a trace a path with a for loop but it should not arrive on the same place it started because the angle of rotation should…
-1
votes
1 answer

Index is out of range(even when I've set a maximum value)

Trying to create the game of life. When looping through the list of cells, although I only scan for (abs(1-j)) or set a maximum value of j so that it can't go above the number of cells within the program. Here's my code: from graphics import * …
jamie
  • 176
  • 1
  • 12
-1
votes
3 answers

Cutting the codes in the program and making it neater

I'm having a hard time cutting the code and making it into a loop so that it would make the code of the program, neater. Although my code works as it suppose to be, I think there is a right way of creating it, adding a for loop rather than writing…
-1
votes
1 answer

How to do animation using Zelle graphics module?

I need help to design my graphics, without turtle nor tkinter, but with Zelle graphics.py. The problem is that I need to run 4 circles moving at the same time. Here's the code I have so far: from graphics import * import time #import time…
1 2 3
11
12