diff -r 029011429f80 Lib/idlelib/Bindings.py
--- a/Lib/idlelib/Bindings.py Sun Feb 10 14:44:43 2013 +0200
+++ b/Lib/idlelib/Bindings.py Tue Feb 12 19:00:09 2013 +0530
@@ -20,6 +20,7 @@
('Open _Module...', '<>'),
('Class _Browser', '<>'),
('_Path Browser', '<>'),
+ ('Turtle Demo', '<>'),
None,
('_Save', '<>'),
('Save _As...', '<>'),
diff -r 029011429f80 Lib/idlelib/EditorWindow.py
--- a/Lib/idlelib/EditorWindow.py Sun Feb 10 14:44:43 2013 +0200
+++ b/Lib/idlelib/EditorWindow.py Tue Feb 12 19:00:09 2013 +0530
@@ -246,6 +246,7 @@
text.bind("<>", self.flist.close_all_callback)
text.bind("<>", self.open_class_browser)
text.bind("<>", self.open_path_browser)
+ text.bind("<>", self.open_turtle_demo)
self.set_status_bar()
vbar['command'] = text.yview
@@ -686,6 +687,10 @@
from idlelib import PathBrowser
PathBrowser.PathBrowser(self.flist)
+ def open_turtle_demo(self, event = None):
+ import turtledemo.__main__
+ turtledemo.__main__.main()
+
def gotoline(self, lineno):
if lineno is not None and lineno > 0:
self.text.mark_set("insert", "%d.0" % lineno)
diff -r 029011429f80 Lib/turtledemo/__main__.py
--- a/Lib/turtledemo/__main__.py Sun Feb 10 14:44:43 2013 +0200
+++ b/Lib/turtledemo/__main__.py Tue Feb 12 19:00:09 2013 +0530
@@ -243,7 +243,8 @@
turtle.TurtleScreen._RUNNING = False
#print "stopIt: exitflag = False"
-if __name__ == '__main__':
+def main():
+ global demo
demo = DemoWindow()
RUN = True
while RUN:
@@ -264,3 +265,6 @@
except:
print("BYE!")
RUN = False
+
+if __name__ == '__main__':
+ main()