draw()
The graphics.py method that makes a shape appear in a window; undraw() removes it again.
In more detail
A shape can be drawn in only one window at a time, and drawing it twice raises an error. Shapes drawn later appear on top of earlier ones, so drawing order decides depth.
Example
c.draw(win)
c.undraw()Related terms
- graphics object — A shape in graphics.py, such as a Point, Line, Circle, Rectangle, Oval, Polygon or Text, which you construct and then draw in a window.
- GraphWin — The graphics.py class for a window you can draw in, created as GraphWin(title, width, height).
Taught in
- Repeat Loops And Successive Modification — Hands-on Python: Complete Video Course & Book
- A Graphics Introduction — Hands-on Python: Complete Video Course & Book
- Sample Graphics Programs — Hands-on Python: Complete Video Course & Book
- Graphical Applications With While — Hands-on Python: Complete Video Course & Book