Kaydet (Commit) 60ebb8b0 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Bug #3884: Make the turtle module toplevel again.

üst 8e354835
...@@ -12,7 +12,7 @@ We can remove it, if you don't like it. ...@@ -12,7 +12,7 @@ We can remove it, if you don't like it.
Without using reset() ;-) Without using reset() ;-)
--------------------------------------- ---------------------------------------
""" """
from tkinter.turtle import * from turtle import *
import time import time
def main(): def main():
......
...@@ -23,7 +23,7 @@ mode as fast as possible. ...@@ -23,7 +23,7 @@ mode as fast as possible.
""" """
import math import math
from tkinter.turtle import Turtle, mainloop from turtle import Turtle, mainloop
from time import clock from time import clock
# wrapper for any additional drawing routines # wrapper for any additional drawing routines
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Ein einfaches Programm zur Demonstration von "chaotischem Verhalten". # Ein einfaches Programm zur Demonstration von "chaotischem Verhalten".
from tkinter.turtle import * from turtle import *
def f(x): def f(x):
return 3.9*x*(1-x) return 3.9*x*(1-x)
......
...@@ -10,7 +10,7 @@ and time ...@@ -10,7 +10,7 @@ and time
Press STOP to exit the program! Press STOP to exit the program!
------------------------------------ ------------------------------------
""" """
from tkinter.turtle import * from turtle import *
from datetime import datetime from datetime import datetime
mode("logo") mode("logo")
......
# colormixer # colormixer
from tkinter.turtle import Screen, Turtle, mainloop from turtle import Screen, Turtle, mainloop
import sys import sys
sys.setrecursionlimit(20000) # overcomes, for now, an instability of Python 3.0 sys.setrecursionlimit(20000) # overcomes, for now, an instability of Python 3.0
......
...@@ -11,7 +11,7 @@ This example is a 'breadth-first'-rewrite of ...@@ -11,7 +11,7 @@ This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See: a Logo program written by Erich Neuwirth. See:
http://homepage.univie.ac.at/erich.neuwirth/ http://homepage.univie.ac.at/erich.neuwirth/
""" """
from tkinter.turtle import Turtle, colormode, tracer, mainloop from turtle import Turtle, colormode, tracer, mainloop
from random import randrange from random import randrange
from time import clock from time import clock
......
...@@ -11,7 +11,7 @@ The CurvesTurtle class and the fractal-curve- ...@@ -11,7 +11,7 @@ The CurvesTurtle class and the fractal-curve-
methods are taken from the PythonCard example methods are taken from the PythonCard example
scripts for turtle-graphics. scripts for turtle-graphics.
""" """
from tkinter.turtle import * from turtle import *
from time import sleep, clock from time import sleep, clock
class CurvesTurtle(Pen): class CurvesTurtle(Pen):
......
...@@ -25,7 +25,7 @@ Cultures ...@@ -25,7 +25,7 @@ Cultures
# Mini Lindenmayer tool # Mini Lindenmayer tool
############################### ###############################
from tkinter.turtle import * from turtle import *
def replace( seq, replacementRules, n ): def replace( seq, replacementRules, n ):
for i in range(n): for i in range(n):
......
...@@ -17,7 +17,7 @@ stretched to rectangles by shapesize() ...@@ -17,7 +17,7 @@ stretched to rectangles by shapesize()
To exit press STOP button To exit press STOP button
--------------------------------------- ---------------------------------------
""" """
from tkinter.turtle import * from turtle import *
class Disc(Turtle): class Disc(Turtle):
def __init__(self, n): def __init__(self, n):
......
...@@ -15,7 +15,7 @@ A simple eventdriven paint program ...@@ -15,7 +15,7 @@ A simple eventdriven paint program
To exit press STOP button To exit press STOP button
------------------------------------------- -------------------------------------------
""" """
from tkinter.turtle import * from turtle import *
def switchupdown(x=0, y=0): def switchupdown(x=0, y=0):
if pen()["pendown"]: if pen()["pendown"]:
......
...@@ -13,7 +13,7 @@ Intentionally no variables are used except for the ...@@ -13,7 +13,7 @@ Intentionally no variables are used except for the
colorloop: colorloop:
""" """
from tkinter.turtle import * from turtle import *
def main(): def main():
peacecolors = ("red3", "orange", "yellow", peacecolors = ("red3", "orange", "yellow",
......
...@@ -15,7 +15,7 @@ For more information see: ...@@ -15,7 +15,7 @@ For more information see:
http://en.wikipedia.org/wiki/Penrose_tiling http://en.wikipedia.org/wiki/Penrose_tiling
------------------------------------------- -------------------------------------------
""" """
from tkinter.turtle import * from turtle import *
from math import cos, pi from math import cos, pi
from time import clock, sleep from time import clock, sleep
......
...@@ -17,7 +17,7 @@ the left mouse button with mouse over the ...@@ -17,7 +17,7 @@ the left mouse button with mouse over the
scrollbar of the canvas. scrollbar of the canvas.
""" """
from tkinter.turtle import Shape, Turtle, mainloop, Vec2D as Vec from turtle import Shape, Turtle, mainloop, Vec2D as Vec
from time import sleep from time import sleep
G = 8 G = 8
......
...@@ -15,7 +15,7 @@ always yields None. ...@@ -15,7 +15,7 @@ always yields None.
current pen is cloned. So in the end there current pen is cloned. So in the end there
are 1024 turtles. are 1024 turtles.
""" """
from tkinter.turtle import Turtle, mainloop from turtle import Turtle, mainloop
from time import clock from time import clock
def tree(plist, l, a, f): def tree(plist, l, a, f):
......
...@@ -13,7 +13,7 @@ parallel. ...@@ -13,7 +13,7 @@ parallel.
Followed by a complete undo(). Followed by a complete undo().
""" """
from tkinter.turtle import Screen, Turtle, mainloop from turtle import Screen, Turtle, mainloop
from time import clock, sleep from time import clock, sleep
def mn_eck(p, ne,sz): def mn_eck(p, ne,sz):
......
...@@ -11,7 +11,7 @@ command. ...@@ -11,7 +11,7 @@ command.
""" """
from tkinter.turtle import * from turtle import *
def yin(radius, color1, color2): def yin(radius, color1, color2):
width(3) width(3)
......
...@@ -8,7 +8,7 @@ from idlelib.ColorDelegator import ColorDelegator ...@@ -8,7 +8,7 @@ from idlelib.ColorDelegator import ColorDelegator
from idlelib.textView import view_file # TextViewer from idlelib.textView import view_file # TextViewer
from imp import reload from imp import reload
from tkinter import turtle import turtle
import time import time
STARTUP = 1 STARTUP = 1
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"""turtle example: Using TurtleScreen and RawTurtle """turtle example: Using TurtleScreen and RawTurtle
for drawing on two distinct canvases. for drawing on two distinct canvases.
""" """
from tkinter.turtle import TurtleScreen, RawTurtle, TK from turtle import TurtleScreen, RawTurtle, TK
root = TK.Tk() root = TK.Tk()
cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff") cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff")
......
...@@ -15,6 +15,8 @@ Core and Builtins ...@@ -15,6 +15,8 @@ Core and Builtins
Library Library
------- -------
- Bug #3884: Make the turtle module toplevel again.
What's New in Python 3.0 release candidate 1 What's New in Python 3.0 release candidate 1
============================================ ============================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment