Repository navigation
Turtledemo: exception and minor glitches. #58325
Description
Activity
Win7, 3.2.2, python -m turtledemo in Command Prompt Window
After running clock example, hitting Stop results in following:
Clock face, including hands, is erased. Day and date are left (intentional?), and the following appears back in command prompt window.Exception in Tkinter callback Traceback (most recent call last): File "C:\Programs\Python32\lib\tkinter\__init__.py", line 1399, in __call__ return self.func(*args) File "C:\Programs\Python32\lib\tkinter\__init__.py", line 487, in callit func(*args) File "C:\Programs\Python32\lib\turtledemo\clock.py", line 116, in tick second_hand.setheading(6*sekunde) File "C:\Programs\Python32\lib\turtle.py", line 1936, in setheading self._rotate(angle) File "C:\Programs\Python32\lib\turtle.py", line 3279, in _rotate self._update() File "C:\Programs\Python32\lib\turtle.py", line 2660, in _update self._update_data() File "C:\Programs\Python32\lib\turtle.py", line 2646, in _update_data self.screen._incrementudc() File "C:\Programs\Python32\lib\turtle.py", line 1285, in _incrementudc raise Terminator turtle.Terminator
Demo continues to run.
Paint: Left clicking mouse moves dot without painting. Right clicking changes mode so left clicking draws line. It also causes some filling of enclosed regions. This double action is slightly obscure. The prompt on the bottom of the screen says "Use mouse/keys or Stop" As near as I can tell, keys are inactive. So prompt could delete '/keys'.
Module doc strings that explain each demo should be wrapped so that they appear in the code window without scrolling. Or the left window could be wider, especially if the user widens the window. 800x600 screens are pretty rare these days.
'Wikipedia' is a poor name for something just because it happened to be there. 'Rosette', for instance, would be better.
- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Feb 24, 2012 Confirmed still a problem in 3.4.1 on Win7.
bpo-21823 fixed the Terminator issue 3 days ago.
bpo-21597 is about making the text pane resizable.
The doc strings for peace, planet_and_moon, and tree need a bit of re-wrapping. The paint instruction is wrong. I am working on these now."Use mouse/keys or Stop" is a generic prompts for all 'special' demos that continue after xyz.main returns. keys is never right for the current set of demos.
The text for two_canvases does not load. I think this can be fixed.
New changeset 129ec3d90a67 by Terry Jan Reedy in branch '2.7':
Issue bpo-14117: Inprove help text and docstrings, some for clarity, some just to
http://hg.python.org/cpython/rev/129ec3d90a67New changeset 713a774ca68a by Terry Jan Reedy in branch '3.4':
Issue bpo-14117: Inprove help text and docstrings, some for clarity, some just to
http://hg.python.org/cpython/rev/713a774ca68a21884 removed or moved global system-changing or gui calls to main. Wrapping two_canvases code (except for window preserving mainloop) to a new main fixed its problems.
Should remove reload from main driver, and test.
bpo-22053 added main(), eliminated 'while RUN', and fixed this a 3.x debug shutdown message.
The main remaining problem I am aware of now is that some demos 'print' messages to the console (or shell), which would be a problem if there were not one (as with pythonw). Except for one demo, the messages would fit on the demo window message button. A possible fix would be to call demo.main with the button, so mainloop demos could write back to it.
(Normal demo returns are put there now.)Running through each of the demos, it seems as though only 'penrose' and 'tree' have console/shell output.
'penrose' output is a list of information about the current rendering and has a format like:
Calculation: 0.0009 s
Drawing: 0.0074 s
Together: 0.0083 s
5 kites and 0 darts = 5 pieces.
(... This repeats with updated information for each rendering ...)I believe that there's too much output right now to include this in the demo window's message button area. It might be interesting to show most or all of this information with a turtle.write() in the graphical area, but I think that the better option is just to remove (or at least comment out) the timing information entirely and show only the '5 kites and 0 darts = 5 pieces' portion in the message button area.
I could submit a patch for either 'penrose' option if there's interest.
The 'tree' prints a count of the number of turtles created at the end of the run. Console output looks like:
1024I think this is not very useful, except perhaps when debugging the demo. I've attached a patch which removes this output.
Hi @terry.reedy,
I'm triaging open "turtle" issues. What do you think would be a reasonable next step for this issue? Perhaps: a contributor runs the demo and reports back here with the current behavior experienced.
PR 8002 fixes the remaining minor problems.
See also bpo-35039 which removed now useless clock() calls from Lib/turtledemo/penrose.py.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: