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
44
votes
9 answers

Python: source code string cannot contain null bytes

I'm using Max OS X 10.10.3, and I finally got the graphics.py to show in Python 3, before it was saying no module existed. However, now when I try import graphics, or from graphics import *, I get the message: "source code string cannot contain…
Peter G. Williams
  • 627
  • 1
  • 6
  • 13
7
votes
2 answers

Python Beginner - How to equate a regression line from clicks and display graphically?

I am reading Python Programming by John Zelle and I am stuck on one the exercises shown in the picture below. You can view my code below. I know the code is very ugly. (Any tips are appreciated) Here's my code so far: from graphics import * def…
TyShi
  • 73
  • 4
5
votes
1 answer

Genetic Programming pyeasyGA and Zelle graphics on Python

I wanted to make a simple program to improve my knowledge on this type of programming. I found a really useful library, pyeasyGA, and with it I tried to make a simple program using graphics.py that from a randomly generated sequence of "passes"…
Roberto Aureli
  • 1,428
  • 2
  • 12
  • 23
4
votes
2 answers

How to detect that the user has clicked on the screen in a GraphWin?

I'm trying to learn Python. I need this loop to keep rolling until I click on the screen. I tried using win.getMouse but it's not working. win = GraphWin("game of life", 600, 600) win.setCoords(-1, -3, s+1, s+1) q = True while q: board =…
Raul Quinzani
  • 493
  • 1
  • 4
  • 16
2
votes
2 answers

Unable to import downloaded Zelle graphics module in IDLE

I'm having a trouble downloading the graphics.py file and locating at the appropriate directory. To import the graphics library I downloaded the file at https://mcsp.wartburg.edu/zelle/python, then I located at the LIB directory (I also tried at the…
mateo
  • 21
  • 1
2
votes
1 answer

ValueError: invalid literal for int() with base 10: ''turning entry into integer

I am making a guess the number in Zelle graphics and my program does not seem to be working properly. I am trying to have the Text Entry become an integer. If there are any other problems with what I have done I would appreciate some help. I have…
2
votes
2 answers

Why is my loop still running? (Python Zelle Graphics)

I'm trying to figure out why the while loop in one of my functions is still running even after the points in my graphics are equal, which is when I set it to stop. Is there anything I'm doing wrong? I've tried to switch other things around to get it…
jklo
  • 31
  • 2
2
votes
0 answers

How do I input collision?

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

Zelle graphics in Python: How to move two objects separately

In this program I am able to get the green object to move but not the other one. I commented 'PROBLEM' above an 'if' statement written under function pygame() where I believe the problem exists. Am I supposed to make an elif statement to get the…
Jefford M
  • 23
  • 4
2
votes
1 answer

Graphics.py: How to clear the window?

I have a window and I'm rendering an image onto it. Every frame the position changes, so the problem is that (obviously) it doesn't disappear from the last frame. I want to clear the window every frame. I can't find any clear methods for the window…
2
votes
2 answers

How to use "getMouse() & getMouseNow()" and which file contain these functions?

I used Zelle's "graphics.py" file. I use Thonny. I want to use function "getMouse() & getMouseNow()", but these messages come up. What should I do ? Help Me ! Code : from graphics import * def draw(): win = GraphWin("My Circle", 500, 500) …
user8044729
2
votes
2 answers

How can I make this fractal render faster in Zelle graphics?

This takes over an hour to render this mandelbrot set with only 100 iteration and has taken 10 hours with 10,000 iterations. Is there a way to make it faster: from graphics import * width = 700 height = 700 win =…
2
votes
0 answers

ZelleGraphics Error "Object currently drawn"

Problem I am coming up with this error in the python shell: File "C:\Users\\Desktop\MyPython\ArtemisGraphics1.py", line 619, in draw self._buttons[i].draw(self._win) File "C:\Users\\Desktop\MyPython\ArtemisGraphics1.py", line 435,…
Cassy
  • 21
  • 3
2
votes
1 answer

Python 3 Graphics (Drawing a star)

I am currently using Python Graphics. (This is not the same as "Python Turtle", you can download the site package via a google search of "Python Graphics".) After searching for a while on how to draw a star, I couldn't find any information on this.…
Nate
  • 33
  • 2
  • 4
2
votes
3 answers

How to resize GraphWin window?

I'm using Zelle's graphics library to do some online coursework. Part of the assignment I'm working on seems to assume I can resize an existing GraphWin window. But this hasn't been touched on previously in the course, and looking over the…
Keen
  • 1,327
  • 1
  • 17
  • 25
1
2 3
11 12