summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-01-23 05:36:37 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-01-23 05:36:37 (GMT)
commit592436552816f23b585e0a8e25284eeb1d25a184 (patch)
tree7d86aecf09e47e39bd19fcd31574f84fb2b205d7 /Lib
parente8a57b98ec8f2b161d4ad68ecc1433c9e3caad57 (diff)
downloadcpython-592436552816f23b585e0a8e25284eeb1d25a184.zip
cpython-592436552816f23b585e0a8e25284eeb1d25a184.tar.gz
cpython-592436552816f23b585e0a8e25284eeb1d25a184.tar.bz2
Issue #17390: Add Python version to Idle editor window title bar.
Original patches by Edmond Burnett and Kent Johnson.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/EditorWindow.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 07ca556..3c1816a 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -1,5 +1,6 @@
import sys
import os
+from platform import python_version
import re
import imp
from Tkinter import *
@@ -965,11 +966,14 @@ class EditorWindow(object):
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