Import graphics error

Nicolae Morkov morkovnicolae at gmail.com
Tue Apr 5 12:26:04 EDT 2016


*Import graphics error*
I copied the code below from Python for Everyone page 67.....

# This program creates a graphics window with a rectangle. It provides the
3 # template used with all of the graphical programs used in the book.
4 #
5
6 from graphics import GraphicsWindow
7
8 # Create the window and access the canvas.
9 win = GraphicsWindow()
10 canvas = win.canvas()
11
12 # Draw on the canvas.
13 canvas.drawRect(5, 10, 20, 30)
14
15 # Wait for the user to close the window.
16 win.wait()


**This is the error I get* *

Traceback (most recent call last):
File
"C:/Users/Nicolae/AppData/Local/Programs/Python/Python35/pythonK/pr.py",
line 1, in <module>
from graphics import GraphicsWindow
ImportError: No module named 'graphics'


*Following the instructions I copied The graphic modules by John Zelle in
Python folder in Lib folder *
**And when I installed graphic library the error was :* *

Traceback (most recent call last):
File
"C:/Users/Nicolae/AppData/Local/Programs/Python/Python35/pythonK/pr.py",
line 1, in <module>
from graphics import GraphicsWindow
ImportError: cannot import name 'GraphicsWindow'
-- 
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list