changeset: 88642:b26db63bb931 branch: 3.3 parent: 88637:b3c2472c12a1 user: Terry Jan Reedy date: Thu Jan 23 00:36:46 2014 -0500 files: Lib/idlelib/EditorWindow.py Misc/NEWS description: Issue #17390: Add Python version to Idle editor window title bar. Original patches by Edmond Burnett and Kent Johnson. diff -r b3c2472c12a1 -r b26db63bb931 Lib/idlelib/EditorWindow.py --- a/Lib/idlelib/EditorWindow.py Wed Jan 22 22:24:46 2014 +1000 +++ b/Lib/idlelib/EditorWindow.py Thu Jan 23 00:36:46 2014 -0500 @@ -1,6 +1,7 @@ import importlib import importlib.abc import os +from platform import python_version import re import string import sys @@ -955,11 +956,14 @@ self.undo.reset_undo() def short_title(self): + pyversion = "Python " + python_version() + ": " filename = self.io.filename if filename: filename = os.path.basename(filename) + else: + filename = "Untitled" # return unicode string to display non-ASCII chars correctly - return self._filename_to_unicode(filename) + return pyversion + self._filename_to_unicode(filename) def long_title(self): # return unicode string to display non-ASCII chars correctly diff -r b3c2472c12a1 -r b26db63bb931 Misc/NEWS --- a/Misc/NEWS Wed Jan 22 22:24:46 2014 +1000 +++ b/Misc/NEWS Thu Jan 23 00:36:46 2014 -0500 @@ -274,6 +274,9 @@ IDLE ---- +--Issue #17390: Add Python version to Idle editor window title bar. + Original patches by Edmond Burnett and Kent Johnson. + - Issue #18960: IDLE now ignores the source encoding declaration on the second line if the first line contains anything except a comment.