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
-1
votes
1 answer

Python Zelle Graphics & While loop

I'm trying to create non-overlapping rectangle flashcards and place them at random locations in Zelle Graphics. xMin and yMin is the coordinate of the upper left corner, and xMax and yMax is of the lower right corner of the rectangle. I tried…
chocolatte
  • 352
  • 4
  • 15
-1
votes
1 answer

This code is not executing in IDLE 3.6.1

from graphics import* import time def moveAll(shapeList,dx,dy): for shape in shapeList: shape.move(dx,dy) def moveAllOnLine(shapeList,dx,dy,repititions,delay): for i in range(repititions): moveAll(shapeList,dx,dy) …
-1
votes
1 answer

IDLE3.6.1 is just running console window but not executing

The following code in python graphics of IDLE3.6.1 is not running it is just running console window but not executing: from graphics import* import time def moveAll(shapeList,dx,dy): for shape in shapeList: shape.move(dx,dy) def…
-1
votes
1 answer

Error importing Zelle's graphics.py package

I am working though Zelle's Python book (Python 2.7.5, Canopy Express, Windows 7). For Chapter 5 you need to install his graphics package, graphics.py. I downloaded the current version, put it in the C:\Python27\Lib\site-packages folder and made…
-2
votes
2 answers

Detect if you click inside a box in Python Zelle graphics

I have created a dice betting game. When my code is run, there is a "CLICK TO ROLL" button. Currently, if you click anywhere on the screen, the dice will roll. How can I make it so the program closes if you click anywhere outside the box, and only…
Ryan M
  • 11
  • 2
-2
votes
2 answers

How do I implement collision detection?

from graphics import* import time import random def main(): numx=random.randint(10,700) wn=GraphWin("AK",700,700) wn.setBackground("white") msg=Text(Point(25,30),"Score") msg.setSize(12) msg.setTextColor('blue') …
-2
votes
2 answers

Invoke Python Zelle graphics drawLine() via interactively mousing points

https://www.cs.swarthmore.edu/~newhall/cs21/pythondocs/using-graphics.html I'm trying to create a Python Zelle graphics function that will allow the user to use the mouse to click two points of his/her choice to draw a line. This is what I have so…
Antonio
  • 101
  • 8
-2
votes
1 answer

Python loop through colours

PYTHON HELP I've got a series of patches drawn in a grid entered by the user but want them to loop through a series of colours which are also typed by the user. i.e. the user enters 'blue, green, yellow' and the patches should follow that loop…
Mark.k
  • 1
  • 2
-2
votes
3 answers

Need assistance in refactoring this function

I am currently in the process of completing a college assignment. We have been using John Zelle's graphics.py module for the first semester. The task was to construct two different patterns, and then lay them out in a particular design,…
Matt Kent
  • 1,145
  • 1
  • 11
  • 26
-3
votes
1 answer

main() function at the end of a graphics python returning syntax

I just redownloaded the graphics.py file, and it's in the same folder as my Python 3.7 folder. I'm trying to learn the graphics interface by typing this simple code in and testing it, however, it keeps giving me an error. >>> import graphics …
-4
votes
1 answer

How can I create an airplane radar using python graphics? (draw)

from graphics import* def main(): win = GraphWin("My Window",500,500) win.setBackground(color_rgb(0,0,0)) #Point pt = Point(250,250) pt.setOutline(color_rgb(255,255,0)) pt.draw(win) win.getMouse() win.close()…
-4
votes
1 answer

Function to draw building with windows and doors

I'm creating a function to draw a office tower: windows are 20 pixels square the gap between the windows is 10 pixels the door is 20 pixels wide, 50 pixels tall, and orange My code doesn't draw it properly: from graphics import * from random…
1 2 3
11
12