12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #14.06.2018
- #Linda Napieralski
- #Andre Giesbrecht
- #Alexa Tschernitschek
- #Modul importieren
- import Tkinter as tk
- import turtle
- #Hauptfenster erstellen
- Hauptfenster = tk.Tk()
- Hauptfenster.title ("Roboter") #Fenstertitel
- cv = tk.Canvas(Hauptfenster, width=600, height=600, background= "white") #canvas=Zeichenflaeche
- cv.pack(side = tk.LEFT) #Zeichenflaeche links positionieren
- #Turtle_Fenster = Rasenfenster (gruen) erzeugen
- t = turtle.RawTurtle(cv)
- Rasen = t.getscreen()
- Rasen.setworldcoordinates(0,0,400,400)
- Rasen.bgcolor("green") #Hintergrundfarbe gruen
- #Frame auf der Rechten Seite
- frame= tk.Frame(Hauptfenster)
- frame.pack(side= tk.RIGHT, fill=tk.BOTH)
- pointLabel = tk.Label(frame,width = 50, height= 10)
- pointLabel.pack()
- #Start-Button
- button= tk.Button(frame)
- button ["text"] = "Start"
- button ["background"] = "blue"
- button.pack()
- # Klick= Funktion
- Hauptfenster.mainloop()
- #Der Roboter
- t.goto(200,200)
- #turtle.goto(200,200)
- t.color("red")
- t.begin_fill()
- t.circle(20)
- t.end_fill()
|