diff -r 46af5ff86580 Lib/idlelib/Bindings.py --- a/Lib/idlelib/Bindings.py Thu Jul 24 14:25:56 2014 -0700 +++ b/Lib/idlelib/Bindings.py Thu Jul 24 18:20:09 2014 -0700 @@ -8,6 +8,8 @@ windows. """ +import imp + from idlelib.configHandler import idleConf # Warning: menudefs is altered in macosxSupport.overrideRootMenu() @@ -86,4 +88,10 @@ ]), ] +try: + imp.find_module('turtledemo') + menudefs[-1][1].append(('Turtle Demo', '<>')) +except ImportError: + pass + default_keydefs = idleConf.GetCurrentKeySet() diff -r 46af5ff86580 Lib/idlelib/EditorWindow.py --- a/Lib/idlelib/EditorWindow.py Thu Jul 24 14:25:56 2014 -0700 +++ b/Lib/idlelib/EditorWindow.py Thu Jul 24 18:20:09 2014 -0700 @@ -222,6 +222,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 @@ -705,6 +706,12 @@ from idlelib import PathBrowser PathBrowser.PathBrowser(self.flist) + def open_turtle_demo(self, event = None): + import subprocess + + cmd = "./python.exe -c 'from turtledemo.__main__ import main; main()'" + p = subprocess.Popen(cmd, shell=True) + def gotoline(self, lineno): if lineno is not None and lineno > 0: self.text.mark_set("insert", "%d.0" % lineno) @@ -713,7 +720,7 @@ self.center() def ispythonsource(self, filename): - if not filename or os.path.isdir(filename): + if not filename or os.path.isdir(filename): return True base, ext = os.path.splitext(os.path.basename(filename)) if os.path.normcase(ext) in (".py", ".pyw"):