Created
August 18, 2016 17:01
-
-
Save CSaratakij/86b5d04952a17cc250ac87bb23ef90f5 to your computer and use it in GitHub Desktop.
Test Exit Turtle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import turtle, sys | |
from turtle import Turtle | |
from turtle import Screen | |
class MyTurtle(Turtle): | |
def quit(self, btn, fun): | |
sys.exit() | |
window = Screen() | |
myTurtle = MyTurtle() | |
turtle.onclick(myTurtle.quit) | |
window.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment