mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-125665: Update turtledemo docstrings with correct file names (#125691)
Co-authored-by: Wulian <xiguawulian@gmail.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
		
							parent
							
								
									6f26d496d3
								
							
						
					
					
						commit
						9c01db40aa
					
				
					 20 changed files with 32 additions and 86 deletions
				
			
		|  | @ -2778,9 +2778,6 @@ Changes since Python 3.0 | ||||||
|   :func:`Screen.numinput <numinput>`. These pop up input dialogs and return |   :func:`Screen.numinput <numinput>`. These pop up input dialogs and return | ||||||
|   strings and numbers respectively. |   strings and numbers respectively. | ||||||
| 
 | 
 | ||||||
| - Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` |  | ||||||
|   have been added to the :file:`Lib/turtledemo` directory. |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| .. doctest:: | .. doctest:: | ||||||
|    :skipif: _tkinter is None |    :skipif: _tkinter is None | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """      turtle-example-suite: | """turtledemo/bytedesign.py | ||||||
| 
 |  | ||||||
|         tdemo_bytedesign.py |  | ||||||
| 
 | 
 | ||||||
| An example adapted from the example-suite | An example adapted from the example-suite | ||||||
| of PythonCard's turtle graphics. | of PythonCard's turtle graphics. | ||||||
|  |  | ||||||
|  | @ -1,9 +1,7 @@ | ||||||
| # File: tdemo_chaos.py | """turtledemo/chaos.py | ||||||
| # Author: Gregor Lingl |  | ||||||
| # Date: 2009-06-24 |  | ||||||
| 
 |  | ||||||
| # A demonstration of chaos |  | ||||||
| 
 | 
 | ||||||
|  | A demonstration of chaos. | ||||||
|  | """ | ||||||
| from turtle import * | from turtle import * | ||||||
| 
 | 
 | ||||||
| N = 80 | N = 80 | ||||||
|  |  | ||||||
|  | @ -1,12 +1,7 @@ | ||||||
| """       turtle-example-suite: | """turtledemo/clock.py | ||||||
| 
 |  | ||||||
|            turtledemo/clock.py |  | ||||||
| 
 | 
 | ||||||
| Enhanced clock-program, showing date | Enhanced clock-program, showing date | ||||||
| and time | and time. | ||||||
|   ------------------------------------ |  | ||||||
|    Press STOP to exit the program! |  | ||||||
|   ------------------------------------ |  | ||||||
| """ | """ | ||||||
| from turtle import * | from turtle import * | ||||||
| from datetime import datetime | from datetime import datetime | ||||||
|  |  | ||||||
|  | @ -1,5 +1,4 @@ | ||||||
| # colormixer | """turtledemo/colormixer.py""" | ||||||
| 
 |  | ||||||
| from turtle import Screen, Turtle, mainloop | from turtle import Screen, Turtle, mainloop | ||||||
| 
 | 
 | ||||||
| class ColorTurtle(Turtle): | class ColorTurtle(Turtle): | ||||||
|  |  | ||||||
|  | @ -1,14 +1,11 @@ | ||||||
| """     turtlegraphics-example-suite: | """turtledemo/forest.py | ||||||
| 
 | 
 | ||||||
|              tdemo_forest.py | Displays a 'forest' of 3 breadth-first trees, | ||||||
|  | similar to the one in tree.py. | ||||||
|  | For further details, see tree.py. | ||||||
| 
 | 
 | ||||||
| Displays a 'forest' of 3 breadth-first-trees | This example is a breadth-first rewrite of | ||||||
| similar to the one in tree. | a Logo program by Erich Neuwirth. | ||||||
| For further remarks see tree.py |  | ||||||
| 
 |  | ||||||
| This example is a 'breadth-first'-rewrite of |  | ||||||
| a Logo program written by Erich Neuwirth. See |  | ||||||
| http://homepage.univie.ac.at/erich.neuwirth/ |  | ||||||
| """ | """ | ||||||
| from turtle import Turtle, colormode, tracer, mainloop | from turtle import Turtle, colormode, tracer, mainloop | ||||||
| from random import randrange | from random import randrange | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """      turtle-example-suite: | """turtledemo/fractalcurves.py | ||||||
| 
 |  | ||||||
|         tdemo_fractalCurves.py |  | ||||||
| 
 | 
 | ||||||
| This program draws two fractal-curve-designs: | This program draws two fractal-curve-designs: | ||||||
| (1) A hilbert curve (in a box) | (1) A hilbert curve (in a box) | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """       turtle-example-suite: | """turtledemo/lindenmayer.py | ||||||
| 
 |  | ||||||
|         xtx_lindenmayer_indian.py |  | ||||||
| 
 | 
 | ||||||
| Each morning women in Tamil Nadu, in southern | Each morning women in Tamil Nadu, in southern | ||||||
| India, place designs, created by using rice | India, place designs, created by using rice | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """       turtle-example-suite: | """turtledemo/minimal_hanoi.py | ||||||
| 
 |  | ||||||
|          tdemo_minimal_hanoi.py |  | ||||||
| 
 | 
 | ||||||
| A minimal 'Towers of Hanoi' animation: | A minimal 'Towers of Hanoi' animation: | ||||||
| A tower of 6 discs is transferred from the | A tower of 6 discs is transferred from the | ||||||
|  | @ -12,9 +10,6 @@ | ||||||
| 
 | 
 | ||||||
| Discs are turtles with shape "square", but | Discs are turtles with shape "square", but | ||||||
| stretched to rectangles by shapesize() | stretched to rectangles by shapesize() | ||||||
|  --------------------------------------- |  | ||||||
|        To exit press STOP button |  | ||||||
|  --------------------------------------- |  | ||||||
| """ | """ | ||||||
| from turtle import * | from turtle import * | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """      turtle-example-suite: | """turtledemo/nim.py | ||||||
| 
 |  | ||||||
|             tdemo_nim.py |  | ||||||
| 
 | 
 | ||||||
| Play nim against the computer. The player | Play nim against the computer. The player | ||||||
| who takes the last stick is the winner. | who takes the last stick is the winner. | ||||||
|  |  | ||||||
|  | @ -1,12 +1,9 @@ | ||||||
| """       turtle-example-suite: | """turtledemo/paint.py | ||||||
| 
 | 
 | ||||||
|             tdemo_paint.py | A simple  event-driven paint program. | ||||||
| 
 | - Left mouse button moves turtle. | ||||||
| A simple  event-driven paint program | - Middle mouse button changes color. | ||||||
| 
 | - Right mouse button toggles between pen up | ||||||
| - left mouse button moves turtle |  | ||||||
| - middle mouse button changes color |  | ||||||
| - right mouse button toggles between pen up |  | ||||||
| (no line drawn when the turtle moves) and | (no line drawn when the turtle moves) and | ||||||
| pen down (line is drawn). If pen up follows | pen down (line is drawn). If pen up follows | ||||||
| at least two pen-down moves, the polygon that | at least two pen-down moves, the polygon that | ||||||
|  | @ -14,8 +11,6 @@ | ||||||
|  ------------------------------------------- |  ------------------------------------------- | ||||||
|  Play around by clicking into the canvas |  Play around by clicking into the canvas | ||||||
|  using all three mouse buttons. |  using all three mouse buttons. | ||||||
|  ------------------------------------------- |  | ||||||
|           To exit press STOP button |  | ||||||
|  ------------------------------------------- |  ------------------------------------------- | ||||||
| """ | """ | ||||||
| from turtle import * | from turtle import * | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """       turtle-example-suite: | """turtledemo/peace.py | ||||||
| 
 |  | ||||||
|               tdemo_peace.py |  | ||||||
| 
 | 
 | ||||||
| A simple drawing suitable as a beginner's | A simple drawing suitable as a beginner's | ||||||
| programming example. Aside from the | programming example. Aside from the | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """       xturtle-example-suite: | """turtledemo/penrose.py | ||||||
| 
 |  | ||||||
|           xtx_kites_and_darts.py |  | ||||||
| 
 | 
 | ||||||
| Constructs two aperiodic penrose-tilings, | Constructs two aperiodic penrose-tilings, | ||||||
| consisting of kites and darts, by the method | consisting of kites and darts, by the method | ||||||
|  | @ -11,7 +9,7 @@ | ||||||
| consisting of five darts. | consisting of five darts. | ||||||
| 
 | 
 | ||||||
| For more information see: | For more information see: | ||||||
|  http://en.wikipedia.org/wiki/Penrose_tiling |  https://en.wikipedia.org/wiki/Penrose_tiling | ||||||
|  ------------------------------------------- |  ------------------------------------------- | ||||||
| """ | """ | ||||||
| from turtle import * | from turtle import * | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """       turtle-example-suite: | """turtledemo/planets_and_moon.py | ||||||
| 
 |  | ||||||
|         tdemo_planets_and_moon.py |  | ||||||
| 
 | 
 | ||||||
| Gravitational system simulation using the | Gravitational system simulation using the | ||||||
| approximation method from Feynman-lectures, | approximation method from Feynman-lectures, | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """      turtle-example-suite: | """turtledemo/rosette.py | ||||||
| 
 |  | ||||||
|           tdemo_wikipedia3.py |  | ||||||
| 
 | 
 | ||||||
| This example is | This example is | ||||||
| inspired by the Wikipedia article on turtle | inspired by the Wikipedia article on turtle | ||||||
|  |  | ||||||
|  | @ -1,9 +1,4 @@ | ||||||
| """      turtle-example-suite: | """turtledemo/round_dance.py | ||||||
| 
 |  | ||||||
|          tdemo_round_dance.py |  | ||||||
| 
 |  | ||||||
| (Needs version 1.1 of the turtle module that |  | ||||||
| comes with Python 3.1) |  | ||||||
| 
 | 
 | ||||||
| Dancing turtles have a compound shape | Dancing turtles have a compound shape | ||||||
| consisting of a series of triangles of | consisting of a series of triangles of | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """ | """turtledemo/sorting_animation.py | ||||||
| 
 |  | ||||||
|          sorting_animation.py |  | ||||||
| 
 | 
 | ||||||
| A minimal sorting algorithm animation: | A minimal sorting algorithm animation: | ||||||
| Sorts a shelf of 10 blocks using insertion | Sorts a shelf of 10 blocks using insertion | ||||||
|  | @ -10,9 +8,6 @@ | ||||||
| 
 | 
 | ||||||
| Blocks are turtles with shape "square", but | Blocks are turtles with shape "square", but | ||||||
| stretched to rectangles by shapesize() | stretched to rectangles by shapesize() | ||||||
|  --------------------------------------- |  | ||||||
|        To exit press space button |  | ||||||
|  --------------------------------------- |  | ||||||
| """ | """ | ||||||
| from turtle import * | from turtle import * | ||||||
| import random | import random | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """      turtle-example-suite: | """turtledemo/tree.py | ||||||
| 
 |  | ||||||
|              tdemo_tree.py |  | ||||||
| 
 | 
 | ||||||
| Displays a 'breadth-first-tree' - in contrast | Displays a 'breadth-first-tree' - in contrast | ||||||
| to the classical Logo tree drawing programs, | to the classical Logo tree drawing programs, | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| """turtledemo.two_canvases | """turtledemo/two_canvases.py | ||||||
| 
 | 
 | ||||||
| Use TurtleScreen and RawTurtle to draw on two | Use TurtleScreen and RawTurtle to draw on two | ||||||
| distinct canvases in a separate window. The | distinct canvases in a separate window. The | ||||||
|  |  | ||||||
|  | @ -1,6 +1,4 @@ | ||||||
| """       turtle-example-suite: | """turtledemo/yinyang.py | ||||||
| 
 |  | ||||||
|             tdemo_yinyang.py |  | ||||||
| 
 | 
 | ||||||
| Another drawing suitable as a beginner's | Another drawing suitable as a beginner's | ||||||
| programming example. | programming example. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wulian
						Wulian