Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106505
| From | Nicolae Morkov <morkovnicolae@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Import graphics error |
| Date | 2016-04-05 11:19 +0100 |
| Message-ID | <mailman.61.1459851765.32530.python-list@python.org> (permalink) |
| References | <CAO5nurM_6d+3Tz5-=uo1w_nVygFtuwatjejHvhfkUTD-DhvBoA@mail.gmail.com> |
# 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'
*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'
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Import graphics error Nicolae Morkov <morkovnicolae@gmail.com> - 2016-04-05 11:19 +0100
Re: Import graphics error Steven D'Aprano <steve@pearwood.info> - 2016-04-05 20:33 +1000
Re: Import graphics error Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-05 08:23 -0400
csiph-web