@@ -359,18 +359,18 @@ Turtle motion
359
359
.. doctest ::
360
360
:skipif: _tkinter is None
361
361
362
- >>> tp = turtle.pos()
363
- >>> tp
364
- (0.00,0.00)
365
- >>> turtle.setpos(60 ,30 )
366
- >>> turtle.pos()
367
- (60.00,30.00)
368
- >>> turtle.setpos((20 ,80 ))
369
- >>> turtle.pos()
370
- (20.00,80.00)
371
- >>> turtle.setpos(tp)
372
- >>> turtle.pos()
373
- (0.00,0.00)
362
+ >>> tp = turtle.pos()
363
+ >>> tp
364
+ (0.00,0.00)
365
+ >>> turtle.setpos(60 ,30 )
366
+ >>> turtle.pos()
367
+ (60.00,30.00)
368
+ >>> turtle.setpos((20 ,80 ))
369
+ >>> turtle.pos()
370
+ (20.00,80.00)
371
+ >>> turtle.setpos(tp)
372
+ >>> turtle.pos()
373
+ (0.00,0.00)
374
374
375
375
376
376
.. function :: teleport(x, y=None, *, fill_gap=False)
@@ -395,18 +395,18 @@ Turtle motion
395
395
.. doctest ::
396
396
:skipif: _tkinter is None
397
397
398
- >>> tp = turtle.pos()
399
- >>> tp
400
- (0.00,0.00)
401
- >>> turtle.teleport(60 )
402
- >>> turtle.pos()
403
- (60.00,0.00)
404
- >>> turtle.teleport(y = 10 )
405
- >>> turtle.pos()
406
- (60.00,10.00)
407
- >>> turtle.teleport(20 , 30 )
408
- >>> turtle.pos()
409
- (20.00,30.00)
398
+ >>> tp = turtle.pos()
399
+ >>> tp
400
+ (0.00,0.00)
401
+ >>> turtle.teleport(60 )
402
+ >>> turtle.pos()
403
+ (60.00,0.00)
404
+ >>> turtle.teleport(y = 10 )
405
+ >>> turtle.pos()
406
+ (60.00,10.00)
407
+ >>> turtle.teleport(20 , 3
D7AE
0 )
408
+ >>> turtle.pos()
409
+ (20.00,30.00)
410
410
411
411
.. versionadded: 3.12
412
412
@@ -950,23 +950,23 @@ Color control
950
950
.. doctest ::
951
951
:skipif: _tkinter is None
952
952
953
- >>> colormode()
954
- 1.0
955
- >>> turtle.pencolor()
956
- 'red'
957
- >>> turtle.pencolor(" brown" )
958
- >>> turtle.pencolor()
959
- 'brown'
960
- >>> tup = (0.2 , 0.8 , 0.55 )
961
- >>> turtle.pencolor(tup)
962
- >>> turtle.pencolor()
963
- (0.2, 0.8, 0.5490196078431373)
964
- >>> colormode(255 )
965
- >>> turtle.pencolor()
966
- (51.0, 204.0, 140.0)
967
- >>> turtle.pencolor(' #32c18f' )
968
- >>> turtle.pencolor()
969
- (50.0, 193.0, 143.0)
953
+ >>> colormode()
954
+ 1.0
955
+ >>> turtle.pencolor()
956
+ 'red'
957
+ >>> turtle.pencolor(" brown" )
958
+ >>> turtle.pencolor()
959
+ 'brown'
960
+ >>> tup = (0.2 , 0.8 , 0.55 )
961
+ >>> turtle.pencolor(tup)
962
+ >>> turtle.pencolor()
963
+ (0.2, 0.8, 0.5490196078431373)
964
+ >>> colormode(255 )
965
+ >>> turtle.pencolor()
966
+ (51.0, 204.0, 140.0)
967
+ >>> turtle.pencolor(' #32c18f' )
968
+ >>> turtle.pencolor()
969
+ (50.0, 193.0, 143.0)
970
970
971
971
972
972
.. function :: fillcolor(*args)
@@ -999,17 +999,17 @@ Color control
999
999
.. doctest ::
1000
1000
:skipif: _tkinter is None
1001
1001
1002
- >>> turtle.fillcolor(" violet" )
1003
- >>> turtle.fillcolor()
1004
- 'violet'
1005
- >>> turtle.pencolor()
1006
- (50.0, 193.0, 143.0)
1007
- >>> turtle.fillcolor((50 , 193 , 143 )) # Integers, not floats
1008
- >>> turtle.fillcolor()
1009
- (50.0, 193.0, 143.0)
1010
- >>> turtle.fillcolor(' #ffffff' )
1011
- >>> turtle.fillcolor()
1012
- (255.0, 255.0, 255.0)
1002
+ >>> turtle.fillcolor(" violet" )
1003
+ >>> turtle.fillcolor()
1004
+ 'violet'
1005
+ >>> turtle.pencolor()
1006
+ (50.0, 193.0, 143.0)
1007
+ >>> turtle.fillcolor((50 , 193 , 143 )) # Integers, not floats
1008
+ >>> turtle.fillcolor()
1009
+ (50.0, 193.0, 143.0)
1010
+ >>> turtle.fillcolor(' #ffffff' )
1011
+ >>> turtle.fillcolor()
1012
+ (255.0, 255.0, 255.0)
1013
1013
1014
1014
1015
1015
.. function :: color(*args)
@@ -1038,12 +1038,12 @@ Color control
1038
1038
.. doctest ::
1039
1039
:skipif: _tkinter is None
1040
1040
1041
- >>> turtle.color(" red" , " green" )
1042
- >>> turtle.color()
1043
- ('red', 'green')
1044
- >>> color(" #285078" , " #a0c8f0" )
1045
- >>> color()
1046
- ((40.0, 80.0, 120.0), (160.0, 200.0, 240.0))
1041
+ >>> turtle.color(" red" , " green" )
1042
+ >>> turtle.color()
1043
+ ('red', 'green')
1044
+ >>> color(" #285078" , " #a0c8f0" )
1045
+ >>> color()
1046
+ ((40.0, 80.0, 120.0), (160.0, 200.0, 240.0))
1047
1047
1048
1048
1049
1049
See also: Screen method :func: `colormode `.
@@ -1065,11 +1065,11 @@ Filling
1065
1065
.. doctest ::
1066
1066
:skipif: _tkinter is None
1067
1067
1068
- >>> turtle.begin_fill()
1069
- >>> if turtle.filling():
1070
- ... turtle.pensize(5 )
1071
- ... else :
1072
- ... turtle.pensize(3 )
1068
+ >>> turtle.begin_fill()
1069
+ >>> if turtle.filling():
1070
+ ... turtle.pensize(5 )
1071
+ ... else :
1072
+ ... turtle.pensize(3 )
1073
1073
1074
1074
1075
1075
@@ -1275,11 +1275,11 @@ Appearance
1275
1275
.. doctest ::
1276
1276
:skipif: _tkinter is None
1277
1277
1278
- >>> turtle.shape(" circle" )
1279
- >>> turtle.shapesize(5 ,2 )
1280
- >>> turtle.shearfactor(0.5 )
1281
- >>> turtle.shearfactor()
1282
- 0.5
1278
+ >>> turtle.shape(" circle" )
1279
+ >>> turtle.shapesize(5 ,2 )
1280
+ >>> turtle.shearfactor(0.5 )
1281
+ >>> turtle.shearfactor()
1282
+ 0.5
1283
1283
1284
1284
1285
1285
.. function :: tilt(angle)
@@ -1648,11 +1648,11 @@ Window control
1648
1648
``"nopic" ``, delete background image, if present. If *picname * is ``None ``,
1649
1649
return the filename of the current backgroundimage. ::
1650
1650
1651
- >>> screen.bgpic()
1652
- 'nopic'
1653
- >>> screen.bgpic("landscape.gif")
1654
- >>> screen.bgpic()
1655
- "landscape.gif"
1651
+ >>> screen.bgpic()
1652
+ 'nopic'
1653
+ >>> screen.bgpic("landscape.gif")
1654
+ >>> screen.bgpic()
1655
+ "landscape.gif"
1656
1656
1657
1657
1658
1658
.. function :: clear()
@@ -2059,16 +2059,16 @@ Settings and special methods
2059
2059
2060
2060
Return the height of the turtle window. ::
2061
2061
2062
- >>> screen.window_height()
2063
- 480
2062
+ >>> screen.window_height()
2063
+ 480
2064
2064
2065
2065
2066
2066
.. function :: window_width()
2067
2067
2068
2068
Return the width of the turtle window. ::
2069
2069
2070
- >>> screen.window_width()
2071
- 640
2070
+ >>> screen.window_width()
2071
+ 640
2072
2072
2073
2073
2074
2074
.. _screenspecific :
@@ -2249,12 +2249,12 @@ facilities:
2249
2249
in the range 0..colormode or a 3-tuple of such numbers.
2250
2250
2251
2251
2252
- >>> screen.bgcolor("orange")
2253
- >>> screen.bgcolor()
2254
- "orange"
2255
- >>> screen.bgcolor(0.5,0,0.5)
2256
- >>> screen.bgcolor()
2257
- "#800080"
2252
+ >>> screen.bgcolor("orange")
2253
+ >>> screen.bgcolor()
2254
+ "orange"
2255
+ >>> screen.bgcolor(0.5,0,0.5)
2256
+ >>> screen.bgcolor()
2257
+ "#800080"
2258
2258
2259
2259
>>> help(Turtle.penup)
2260
2260
Help on method penup in module turtle:
0 commit comments