mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Patch #3064: Port new turtle module and demos to 3.0.
This commit is contained in:
parent
b38fea34bf
commit
97cf99fc7e
25 changed files with 7744 additions and 1029 deletions
58
Demo/turtle/tdemo_I_dontlike_tiltdemo.py
Normal file
58
Demo/turtle/tdemo_I_dontlike_tiltdemo.py
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/python
|
||||
""" turtle-example-suite:
|
||||
|
||||
tdemo-I_dont_like_tiltdemo.py
|
||||
|
||||
Demostrates
|
||||
(a) use of a tilted ellipse as
|
||||
turtle shape
|
||||
(b) stamping that shape
|
||||
|
||||
We can remove it, if you don't like it.
|
||||
Without using reset() ;-)
|
||||
---------------------------------------
|
||||
"""
|
||||
from tkinter.turtle import *
|
||||
import time
|
||||
|
||||
def main():
|
||||
reset()
|
||||
shape("circle")
|
||||
resizemode("user")
|
||||
|
||||
pu(); bk(24*18/6.283); rt(90); pd()
|
||||
tilt(45)
|
||||
|
||||
pu()
|
||||
|
||||
turtlesize(16,10,5)
|
||||
color("red", "violet")
|
||||
for i in range(18):
|
||||
fd(24)
|
||||
lt(20)
|
||||
stamp()
|
||||
color("red", "")
|
||||
for i in range(18):
|
||||
fd(24)
|
||||
lt(20)
|
||||
stamp()
|
||||
|
||||
tilt(-15)
|
||||
turtlesize(3, 1, 4)
|
||||
color("blue", "yellow")
|
||||
for i in range(17):
|
||||
fd(24)
|
||||
lt(20)
|
||||
if i%2 == 0:
|
||||
stamp()
|
||||
time.sleep(1)
|
||||
while undobufferentries():
|
||||
undo()
|
||||
ht()
|
||||
write("OK, OVER!", align="center", font=("Courier", 18, "bold"))
|
||||
return "Done!"
|
||||
|
||||
if __name__=="__main__":
|
||||
msg = main()
|
||||
print(msg)
|
||||
# mainloop()
|
Loading…
Add table
Add a link
Reference in a new issue