summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
committerCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
commit6f2df4d5e193d54244b0c2de91ef0ab1604b9243 (patch)
tree5e172400da7561eb4bb8fafc62c8cab511d74dad /Demo/tkinter
parenta8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (diff)
downloadcpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.zip
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.gz
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.bz2
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
Diffstat (limited to 'Demo/tkinter')
-rwxr-xr-xDemo/tkinter/guido/AttrDialog.py22
-rwxr-xr-xDemo/tkinter/guido/ManPage.py4
-rwxr-xr-xDemo/tkinter/guido/ShellWindow.py2
-rwxr-xr-xDemo/tkinter/guido/dialog.py4
-rwxr-xr-xDemo/tkinter/guido/mbox.py6
-rwxr-xr-xDemo/tkinter/guido/rmt.py2
-rwxr-xr-xDemo/tkinter/guido/solitaire.py4
-rw-r--r--Demo/tkinter/guido/sortvisu.py2
-rw-r--r--Demo/tkinter/guido/ss1.py28
-rwxr-xr-xDemo/tkinter/guido/svkill.py2
-rwxr-xr-xDemo/tkinter/guido/tkman.py8
-rwxr-xr-xDemo/tkinter/guido/wish.py4
-rw-r--r--Demo/tkinter/matt/00-HELLO-WORLD.py2
-rw-r--r--Demo/tkinter/matt/animation-simple.py2
-rw-r--r--Demo/tkinter/matt/animation-w-velocity-ctrl.py2
-rw-r--r--Demo/tkinter/matt/bind-w-mult-calls-p-type.py4
-rw-r--r--Demo/tkinter/matt/canvas-demo-simple.py2
-rw-r--r--Demo/tkinter/matt/canvas-gridding.py2
-rw-r--r--Demo/tkinter/matt/canvas-reading-tag-info.py10
-rw-r--r--Demo/tkinter/matt/canvas-w-widget-draw-el.py2
-rw-r--r--Demo/tkinter/matt/canvas-with-scrollbars.py6
-rw-r--r--Demo/tkinter/matt/dialog-box.py2
-rw-r--r--Demo/tkinter/matt/entry-simple.py2
-rw-r--r--Demo/tkinter/matt/entry-with-shared-variable.py2
-rw-r--r--Demo/tkinter/matt/killing-window-w-wm.py4
-rw-r--r--Demo/tkinter/matt/menu-all-types-of-entries.py8
-rw-r--r--Demo/tkinter/matt/menu-simple.py4
-rw-r--r--Demo/tkinter/matt/packer-and-placer-together.py2
-rw-r--r--Demo/tkinter/matt/packer-simple.py2
-rw-r--r--Demo/tkinter/matt/placer-simple.py2
-rw-r--r--Demo/tkinter/matt/printing-coords-of-items.py2
-rw-r--r--Demo/tkinter/matt/radiobutton-simple.py2
-rw-r--r--Demo/tkinter/matt/rubber-band-box-demo-1.py2
-rw-r--r--Demo/tkinter/matt/rubber-line-demo-1.py2
-rw-r--r--Demo/tkinter/matt/slider-demo-1.py2
-rw-r--r--Demo/tkinter/matt/subclass-existing-widgets.py2
-rw-r--r--Demo/tkinter/matt/two-radio-groups.py6
-rw-r--r--Demo/tkinter/matt/window-creation-more.py2
-rw-r--r--Demo/tkinter/matt/window-creation-simple.py2
-rw-r--r--Demo/tkinter/matt/window-creation-w-location.py4
40 files changed, 86 insertions, 88 deletions
diff --git a/Demo/tkinter/guido/AttrDialog.py b/Demo/tkinter/guido/AttrDialog.py
index d8b2571..98bdd14 100755
--- a/Demo/tkinter/guido/AttrDialog.py
+++ b/Demo/tkinter/guido/AttrDialog.py
@@ -112,7 +112,7 @@ class Dialog:
def addchoices(self):
self.choices = {}
list = []
- for k, dc in self.options.items():
+ for k, dc in list(self.options.items()):
list.append((k, dc))
list.sort()
for k, (d, c) in list:
@@ -157,7 +157,7 @@ class PackDialog(Dialog):
try:
self.dialog.widget.pack(**{self.option: self.current})
except TclError as msg:
- print msg
+ print(msg)
self.refresh()
class booleanoption(packoption, BooleanOption): pass
@@ -213,7 +213,7 @@ class RemotePackDialog(PackDialog):
'info',
self.widget))
except TclError as msg:
- print msg
+ print(msg)
return
dict = {}
for i in range(0, len(words), 2):
@@ -240,7 +240,7 @@ class RemotePackDialog(PackDialog):
self.dialog.master.tk.merge(
self.current))
except TclError as msg:
- print msg
+ print(msg)
self.refresh()
class booleanoption(remotepackoption, BooleanOption): pass
@@ -256,11 +256,11 @@ class WidgetDialog(Dialog):
Dialog.__init__(self, widget)
def fixclasses(self):
- if self.addclasses.has_key(self.klass):
+ if self.klass in self.addclasses:
classes = {}
for c in (self.classes,
self.addclasses[self.klass]):
- for k in c.keys():
+ for k in list(c.keys()):
classes[k] = c[k]
self.classes = classes
@@ -273,7 +273,7 @@ class WidgetDialog(Dialog):
def update(self):
self.current = {}
self.options = {}
- for k, v in self.configuration.items():
+ for k, v in list(self.configuration.items()):
if len(v) > 4:
self.current[k] = v[4]
self.options[k] = v[3], v[2] # default, klass
@@ -286,7 +286,7 @@ class WidgetDialog(Dialog):
try:
self.dialog.widget[self.option] = self.current
except TclError as msg:
- print msg
+ print(msg)
self.refresh()
class booleanoption(widgetoption, BooleanOption): pass
@@ -375,7 +375,7 @@ class RemoteWidgetDialog(WidgetDialog):
self.widget,
'config'))
except TclError as msg:
- print msg
+ print(msg)
return
dict = {}
for item in items:
@@ -399,7 +399,7 @@ class RemoteWidgetDialog(WidgetDialog):
'-'+self.option,
self.current)
except TclError as msg:
- print msg
+ print(msg)
self.refresh()
class booleanoption(remotewidgetoption, BooleanOption): pass
@@ -446,6 +446,6 @@ def opendialogs(e):
try:
RemotePackDialog(list, list.app, widget)
except TclError as msg:
- print msg
+ print(msg)
test()
diff --git a/Demo/tkinter/guido/ManPage.py b/Demo/tkinter/guido/ManPage.py
index b189b64..1266f1c 100755
--- a/Demo/tkinter/guido/ManPage.py
+++ b/Demo/tkinter/guido/ManPage.py
@@ -75,7 +75,7 @@ class EditableManPage(ScrolledText):
# Initialize parsing from a particular file -- must not be busy
def _startparser(self, fp):
if self.busy():
- raise RuntimeError, 'startparser: still busy'
+ raise RuntimeError('startparser: still busy')
fp.fileno() # Test for file-ness
self.fp = fp
self.lineno = 0
@@ -90,7 +90,7 @@ class EditableManPage(ScrolledText):
# End parsing -- must be busy, need not be at EOF
def _endparser(self):
if not self.busy():
- raise RuntimeError, 'endparser: not busy'
+ raise RuntimeError('endparser: not busy')
if self.buffer:
self._parseline('')
try:
diff --git a/Demo/tkinter/guido/ShellWindow.py b/Demo/tkinter/guido/ShellWindow.py
index 104e06d..d7e0a0e 100755
--- a/Demo/tkinter/guido/ShellWindow.py
+++ b/Demo/tkinter/guido/ShellWindow.py
@@ -37,7 +37,7 @@ class ShellWindow(ScrolledText):
if not data:
self.tk.deletefilehandler(file)
pid, sts = os.waitpid(self.pid, 0)
- print 'pid', pid, 'status', sts
+ print('pid', pid, 'status', sts)
self.pid = None
detail = sts>>8
cause = sts & 0xff
diff --git a/Demo/tkinter/guido/dialog.py b/Demo/tkinter/guido/dialog.py
index 50d84b9..426eca4 100755
--- a/Demo/tkinter/guido/dialog.py
+++ b/Demo/tkinter/guido/dialog.py
@@ -81,7 +81,7 @@ def go():
'',
-1,
'OK')
- print 'pressed button', i
+ print('pressed button', i)
i = dialog(mainWidget,
'File Modified',
'File "tcl.h" has been modified since '
@@ -92,7 +92,7 @@ def go():
'Save File',
'Discard Changes',
'Return To Editor')
- print 'pressed button', i
+ print('pressed button', i)
def test():
import sys
diff --git a/Demo/tkinter/guido/mbox.py b/Demo/tkinter/guido/mbox.py
index 47c38b9..88b0b89 100755
--- a/Demo/tkinter/guido/mbox.py
+++ b/Demo/tkinter/guido/mbox.py
@@ -28,7 +28,7 @@ def main():
try:
opts, args = getopt.getopt(sys.argv[1:], '')
except getopt.error as msg:
- print msg
+ print(msg)
sys.exit(2)
for arg in args:
if arg[:1] == '+':
@@ -278,8 +278,6 @@ def rescan():
scanbox.insert('end', line)
def scanfolder(folder = 'inbox', sequence = 'all'):
- return map(
- lambda line: line[:-1],
- os.popen('scan +%s %s' % (folder, sequence), 'r').readlines())
+ return [line[:-1] for line in os.popen('scan +%s %s' % (folder, sequence), 'r').readlines()]
main()
diff --git a/Demo/tkinter/guido/rmt.py b/Demo/tkinter/guido/rmt.py
index 440650c..c177c72 100755
--- a/Demo/tkinter/guido/rmt.py
+++ b/Demo/tkinter/guido/rmt.py
@@ -134,7 +134,7 @@ def fillAppsMenu():
file_m_apps.add('command')
file_m_apps.delete(0, 'last')
names = root.winfo_interps()
- names = map(None, names) # convert tuple to list
+ names = list(names) # convert tuple to list
names.sort()
for name in names:
try:
diff --git a/Demo/tkinter/guido/solitaire.py b/Demo/tkinter/guido/solitaire.py
index 50a8b26..68dc284 100755
--- a/Demo/tkinter/guido/solitaire.py
+++ b/Demo/tkinter/guido/solitaire.py
@@ -80,7 +80,7 @@ for s in (HEARTS, DIAMONDS):
for s in (CLUBS, SPADES):
COLOR[s] = BLACK
-ALLSUITS = COLOR.keys()
+ALLSUITS = list(COLOR.keys())
NSUITS = len(ALLSUITS)
@@ -99,7 +99,7 @@ NVALUES = len(ALLVALUES)
# dummy element at index 0 so it can be indexed directly with the card
# value.
-VALNAMES = ["", "A"] + map(str, range(2, 11)) + ["J", "Q", "K"]
+VALNAMES = ["", "A"] + list(map(str, range(2, 11))) + ["J", "Q", "K"]
# Solitaire constants. The only one I can think of is the number of
diff --git a/Demo/tkinter/guido/sortvisu.py b/Demo/tkinter/guido/sortvisu.py
index 3e4454f..c538a2c 100644
--- a/Demo/tkinter/guido/sortvisu.py
+++ b/Demo/tkinter/guido/sortvisu.py
@@ -344,7 +344,7 @@ def steps(here, there):
def interpolate(oldpts, newpts, n):
if len(oldpts) != len(newpts):
- raise ValueError, "can't interpolate arrays of different length"
+ raise ValueError("can't interpolate arrays of different length")
pts = [0]*len(oldpts)
res = [tuple(oldpts)]
for i in range(1, n):
diff --git a/Demo/tkinter/guido/ss1.py b/Demo/tkinter/guido/ss1.py
index 8935475..d957907 100644
--- a/Demo/tkinter/guido/ss1.py
+++ b/Demo/tkinter/guido/ss1.py
@@ -136,13 +136,13 @@ class Sheet:
return maxx, maxy
def reset(self):
- for cell in self.cells.itervalues():
+ for cell in self.cells.values():
if hasattr(cell, 'reset'):
cell.reset()
def recalc(self):
self.reset()
- for cell in self.cells.itervalues():
+ for cell in self.cells.values():
if hasattr(cell, 'recalc'):
cell.recalc(self.rexec)
@@ -160,7 +160,7 @@ class Sheet:
full[0, y] = text, alignment = str(y), RIGHT
colwidth[0] = max(colwidth[0], len(text))
# Add sheet cells in columns with x>0 and y>0
- for (x, y), cell in self.cells.iteritems():
+ for (x, y), cell in self.cells.items():
if x <= 0 or y <= 0:
continue
if hasattr(cell, 'recalc'):
@@ -192,13 +192,13 @@ class Sheet:
if line:
line += '|'
line += text
- print line
+ print(line)
if y == 0:
- print sep
+ print(sep)
def xml(self):
out = ['<spreadsheet>']
- for (x, y), cell in self.cells.iteritems():
+ for (x, y), cell in self.cells.items():
if hasattr(cell, 'xml'):
cellxml = cell.xml()
else:
@@ -236,7 +236,7 @@ class SheetParser:
def startelement(self, tag, attrs):
method = getattr(self, 'start_'+tag, None)
if method:
- for key, value in attrs.iteritems():
+ for key, value in attrs.items():
attrs[key] = str(value) # XXX Convert Unicode to 8-bit
method(attrs)
self.texts = []
@@ -268,7 +268,7 @@ class SheetParser:
def end_long(self, text):
try:
- self.value = long(text)
+ self.value = int(text)
except:
self.value = None
@@ -325,7 +325,7 @@ class BaseCell:
class NumericCell(BaseCell):
def __init__(self, value, fmt="%s", alignment=RIGHT):
- assert isinstance(value, (int, long, float, complex))
+ assert isinstance(value, (int, int, float, complex))
assert alignment in (LEFT, CENTER, RIGHT)
self.value = value
self.fmt = fmt
@@ -366,7 +366,7 @@ class NumericCell(BaseCell):
class StringCell(BaseCell):
def __init__(self, text, fmt="%s", alignment=LEFT):
- assert isinstance(text, (str, unicode))
+ assert isinstance(text, (str, str))
assert alignment in (LEFT, CENTER, RIGHT)
self.text = text
self.fmt = fmt
@@ -699,7 +699,7 @@ class SheetGUI:
x1, x2 = x2, x1
if y1 > y2:
y1, y2 = y2, y1
- for (x, y), cell in self.gridcells.iteritems():
+ for (x, y), cell in self.gridcells.items():
if x1 <= x <= x2 and y1 <= y <= y2:
cell['bg'] = 'lightBlue'
gridcell = self.gridcells.get(self.currentxy)
@@ -735,7 +735,7 @@ class SheetGUI:
x1, x2 = x2, x1
if y1 > y2:
y1, y2 = y2, y1
- for (x, y), cell in self.gridcells.iteritems():
+ for (x, y), cell in self.gridcells.items():
if x1 <= x <= x2 and y1 <= y <= y2:
cell['bg'] = 'white'
@@ -775,7 +775,7 @@ class SheetGUI:
if text.startswith('='):
cell = FormulaCell(text[1:])
else:
- for cls in int, long, float, complex:
+ for cls in int, int, float, complex:
try:
value = cls(text)
except:
@@ -794,7 +794,7 @@ class SheetGUI:
def sync(self):
"Fill the GUI cells from the sheet cells."
self.sheet.recalc()
- for (x, y), gridcell in self.gridcells.iteritems():
+ for (x, y), gridcell in self.gridcells.items():
if x == 0 or y == 0:
continue
cell = self.sheet.getcell(x, y)
diff --git a/Demo/tkinter/guido/svkill.py b/Demo/tkinter/guido/svkill.py
index 95f61b8..378d58f 100755
--- a/Demo/tkinter/guido/svkill.py
+++ b/Demo/tkinter/guido/svkill.py
@@ -5,7 +5,7 @@
from Tkinter import *
if TkVersion < 4.0:
- raise ImportError, "This version of svkill requires Tk 4.0 or later"
+ raise ImportError("This version of svkill requires Tk 4.0 or later")
from string import splitfields
from string import split
diff --git a/Demo/tkinter/guido/tkman.py b/Demo/tkinter/guido/tkman.py
index 810bdf8..c84d889 100755
--- a/Demo/tkinter/guido/tkman.py
+++ b/Demo/tkinter/guido/tkman.py
@@ -172,8 +172,8 @@ class SelectionBox:
def updatelist(self):
key = self.entry.get()
- ok = filter(lambda name, key=key, n=len(key): name[:n]==key,
- self.choices)
+ ok = list(filter(lambda name, key=key, n=len(key): name[:n]==key,
+ self.choices))
if not ok:
self.frame.bell()
self.listbox.delete(0, AtEnd())
@@ -205,7 +205,7 @@ class SelectionBox:
def search_string(self, search):
if not search:
self.frame.bell()
- print 'Empty search string'
+ print('Empty search string')
return
if not self.casevar.get():
map = re.IGNORECASE
@@ -218,7 +218,7 @@ class SelectionBox:
prog = re.compile(search)
except re.error as msg:
self.frame.bell()
- print 'Regex error:', msg
+ print('Regex error:', msg)
return
here = self.text.index(AtInsert())
lineno = string.atoi(here[:string.find(here, '.')])
diff --git a/Demo/tkinter/guido/wish.py b/Demo/tkinter/guido/wish.py
index 2367e25..bebab1e 100755
--- a/Demo/tkinter/guido/wish.py
+++ b/Demo/tkinter/guido/wish.py
@@ -24,7 +24,7 @@ while 1:
try:
result = tk.call('eval', cmd)
except _tkinter.TclError as msg:
- print 'TclError:', msg
+ print('TclError:', msg)
else:
- if result: print result
+ if result: print(result)
cmd = ''
diff --git a/Demo/tkinter/matt/00-HELLO-WORLD.py b/Demo/tkinter/matt/00-HELLO-WORLD.py
index 1c3151b..20a2050 100644
--- a/Demo/tkinter/matt/00-HELLO-WORLD.py
+++ b/Demo/tkinter/matt/00-HELLO-WORLD.py
@@ -5,7 +5,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT', foreground='red',
diff --git a/Demo/tkinter/matt/animation-simple.py b/Demo/tkinter/matt/animation-simple.py
index b52e1dc..071bde7 100644
--- a/Demo/tkinter/matt/animation-simple.py
+++ b/Demo/tkinter/matt/animation-simple.py
@@ -4,7 +4,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT', foreground='red',
diff --git a/Demo/tkinter/matt/animation-w-velocity-ctrl.py b/Demo/tkinter/matt/animation-w-velocity-ctrl.py
index e676338..68eb1d0 100644
--- a/Demo/tkinter/matt/animation-w-velocity-ctrl.py
+++ b/Demo/tkinter/matt/animation-w-velocity-ctrl.py
@@ -8,7 +8,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT', foreground='red',
diff --git a/Demo/tkinter/matt/bind-w-mult-calls-p-type.py b/Demo/tkinter/matt/bind-w-mult-calls-p-type.py
index f3220da..f744d26 100644
--- a/Demo/tkinter/matt/bind-w-mult-calls-p-type.py
+++ b/Demo/tkinter/matt/bind-w-mult-calls-p-type.py
@@ -24,11 +24,11 @@ class App(Frame):
self.entrythingy.bind('<Key-Return>', self.print_something_else, "+")
def print_contents(self, event):
- print "hi. contents of entry is now ---->", self.entrythingy.get()
+ print("hi. contents of entry is now ---->", self.entrythingy.get())
def print_something_else(self, event):
- print "hi. Now doing something completely different"
+ print("hi. Now doing something completely different")
root = App()
diff --git a/Demo/tkinter/matt/canvas-demo-simple.py b/Demo/tkinter/matt/canvas-demo-simple.py
index a01679a..b677ccd 100644
--- a/Demo/tkinter/matt/canvas-demo-simple.py
+++ b/Demo/tkinter/matt/canvas-demo-simple.py
@@ -4,7 +4,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT', foreground='red',
diff --git a/Demo/tkinter/matt/canvas-gridding.py b/Demo/tkinter/matt/canvas-gridding.py
index 3c52b91..84f4ea0 100644
--- a/Demo/tkinter/matt/canvas-gridding.py
+++ b/Demo/tkinter/matt/canvas-gridding.py
@@ -7,7 +7,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT',
diff --git a/Demo/tkinter/matt/canvas-reading-tag-info.py b/Demo/tkinter/matt/canvas-reading-tag-info.py
index f57ea18..75990c9 100644
--- a/Demo/tkinter/matt/canvas-reading-tag-info.py
+++ b/Demo/tkinter/matt/canvas-reading-tag-info.py
@@ -3,7 +3,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT', foreground='red',
@@ -28,14 +28,14 @@ class Test(Frame):
# is used for widgets. (remember, this is for ITEMS drawn
# on a canvas widget, not widgets)
option_value = self.drawing.itemconfig(pgon, "stipple")
- print "pgon's current stipple value is -->", option_value[4], "<--"
+ print("pgon's current stipple value is -->", option_value[4], "<--")
option_value = self.drawing.itemconfig(pgon, "fill")
- print "pgon's current fill value is -->", option_value[4], "<--"
- print " when he is usually colored -->", option_value[3], "<--"
+ print("pgon's current fill value is -->", option_value[4], "<--")
+ print(" when he is usually colored -->", option_value[3], "<--")
## here we print out all the tags associated with this object
option_value = self.drawing.itemconfig(pgon, "tags")
- print "pgon's tags are", option_value[4]
+ print("pgon's tags are", option_value[4])
self.drawing.pack(side=LEFT)
diff --git a/Demo/tkinter/matt/canvas-w-widget-draw-el.py b/Demo/tkinter/matt/canvas-w-widget-draw-el.py
index 5b26210..3cbf937 100644
--- a/Demo/tkinter/matt/canvas-w-widget-draw-el.py
+++ b/Demo/tkinter/matt/canvas-w-widget-draw-el.py
@@ -4,7 +4,7 @@ from Tkinter import *
class Test(Frame):
def printhi(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT', foreground='red',
diff --git a/Demo/tkinter/matt/canvas-with-scrollbars.py b/Demo/tkinter/matt/canvas-with-scrollbars.py
index 81ef25a..b55215d 100644
--- a/Demo/tkinter/matt/canvas-with-scrollbars.py
+++ b/Demo/tkinter/matt/canvas-with-scrollbars.py
@@ -7,7 +7,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.question = Label(self, text="Can Find The BLUE Square??????")
@@ -46,8 +46,8 @@ class Test(Frame):
def scrollCanvasX(self, *args):
- print "scrolling", args
- print self.draw.scrollX.get()
+ print("scrolling", args)
+ print(self.draw.scrollX.get())
def __init__(self, master=None):
diff --git a/Demo/tkinter/matt/dialog-box.py b/Demo/tkinter/matt/dialog-box.py
index dea8f39..0c71c3a 100644
--- a/Demo/tkinter/matt/dialog-box.py
+++ b/Demo/tkinter/matt/dialog-box.py
@@ -6,7 +6,7 @@ from Dialog import Dialog
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def makeWindow(self):
"""Create a top-level dialog with some buttons.
diff --git a/Demo/tkinter/matt/entry-simple.py b/Demo/tkinter/matt/entry-simple.py
index 5146e6f..0bf4cab 100644
--- a/Demo/tkinter/matt/entry-simple.py
+++ b/Demo/tkinter/matt/entry-simple.py
@@ -17,7 +17,7 @@ class App(Frame):
self.entrythingy.bind('<Key-Return>', self.print_contents)
def print_contents(self, event):
- print "hi. contents of entry is now ---->", self.entrythingy.get()
+ print("hi. contents of entry is now ---->", self.entrythingy.get())
root = App()
root.master.title("Foo")
diff --git a/Demo/tkinter/matt/entry-with-shared-variable.py b/Demo/tkinter/matt/entry-with-shared-variable.py
index 2b76162..c7cd259 100644
--- a/Demo/tkinter/matt/entry-with-shared-variable.py
+++ b/Demo/tkinter/matt/entry-with-shared-variable.py
@@ -39,7 +39,7 @@ class App(Frame):
self.contents.set(str)
def print_contents(self, event):
- print "hi. contents of entry is now ---->", self.contents.get()
+ print("hi. contents of entry is now ---->", self.contents.get())
root = App()
root.master.title("Foo")
diff --git a/Demo/tkinter/matt/killing-window-w-wm.py b/Demo/tkinter/matt/killing-window-w-wm.py
index 6a0e2fe..23ac103 100644
--- a/Demo/tkinter/matt/killing-window-w-wm.py
+++ b/Demo/tkinter/matt/killing-window-w-wm.py
@@ -7,11 +7,11 @@ from Tkinter import *
### ******* this isn't really called -- read the comments
def my_delete_callback():
- print "whoops -- tried to delete me!"
+ print("whoops -- tried to delete me!")
class Test(Frame):
def deathHandler(self, event):
- print self, "is now getting nuked. performing some save here...."
+ print(self, "is now getting nuked. performing some save here....")
def createWidgets(self):
# a hello button
diff --git a/Demo/tkinter/matt/menu-all-types-of-entries.py b/Demo/tkinter/matt/menu-all-types-of-entries.py
index f4afe4a..e4e4bfd 100644
--- a/Demo/tkinter/matt/menu-all-types-of-entries.py
+++ b/Demo/tkinter/matt/menu-all-types-of-entries.py
@@ -35,13 +35,13 @@ from Tkinter import *
# some miscellaneous callbacks
def new_file():
- print "opening new file"
+ print("opening new file")
def open_file():
- print "opening OLD file"
+ print("opening OLD file")
def print_something():
- print "picked a menu item"
+ print("picked a menu item")
@@ -50,7 +50,7 @@ anchovies = 0
def print_anchovies():
global anchovies
anchovies = not anchovies
- print "anchovies?", anchovies
+ print("anchovies?", anchovies)
def makeCommandMenu():
# make menu button
diff --git a/Demo/tkinter/matt/menu-simple.py b/Demo/tkinter/matt/menu-simple.py
index 46b5364..2487561 100644
--- a/Demo/tkinter/matt/menu-simple.py
+++ b/Demo/tkinter/matt/menu-simple.py
@@ -34,11 +34,11 @@ from Tkinter import *
def new_file():
- print "opening new file"
+ print("opening new file")
def open_file():
- print "opening OLD file"
+ print("opening OLD file")
def makeFileMenu():
diff --git a/Demo/tkinter/matt/packer-and-placer-together.py b/Demo/tkinter/matt/packer-and-placer-together.py
index 184d56b..84d3ee0 100644
--- a/Demo/tkinter/matt/packer-and-placer-together.py
+++ b/Demo/tkinter/matt/packer-and-placer-together.py
@@ -8,7 +8,7 @@ def do_motion(event):
app.button.place(x=event.x, y=event.y)
def dothis():
- print 'calling me!'
+ print('calling me!')
def createWidgets(top):
# make a frame. Note that the widget is 200 x 200
diff --git a/Demo/tkinter/matt/packer-simple.py b/Demo/tkinter/matt/packer-simple.py
index f55f1be..1a505dd 100644
--- a/Demo/tkinter/matt/packer-simple.py
+++ b/Demo/tkinter/matt/packer-simple.py
@@ -3,7 +3,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print self.hi_there["command"]
+ print(self.hi_there["command"])
def createWidgets(self):
# a hello button
diff --git a/Demo/tkinter/matt/placer-simple.py b/Demo/tkinter/matt/placer-simple.py
index 30d9e9e..992a8fc 100644
--- a/Demo/tkinter/matt/placer-simple.py
+++ b/Demo/tkinter/matt/placer-simple.py
@@ -6,7 +6,7 @@ def do_motion(event):
app.button.place(x=event.x, y=event.y)
def dothis():
- print 'calling me!'
+ print('calling me!')
def createWidgets(top):
# make a frame. Note that the widget is 200 x 200
diff --git a/Demo/tkinter/matt/printing-coords-of-items.py b/Demo/tkinter/matt/printing-coords-of-items.py
index a37733d..c74c1c3 100644
--- a/Demo/tkinter/matt/printing-coords-of-items.py
+++ b/Demo/tkinter/matt/printing-coords-of-items.py
@@ -35,7 +35,7 @@ class Test(Frame):
# the "current" tag is applied to the object the cursor is over.
# this happens automatically.
self.draw.itemconfig(CURRENT, fill="red")
- print self.draw.coords(CURRENT)
+ print(self.draw.coords(CURRENT))
def mouseLeave(self, event):
# the "current" tag is applied to the object the cursor is over.
diff --git a/Demo/tkinter/matt/radiobutton-simple.py b/Demo/tkinter/matt/radiobutton-simple.py
index e9d6afe..eeddb23 100644
--- a/Demo/tkinter/matt/radiobutton-simple.py
+++ b/Demo/tkinter/matt/radiobutton-simple.py
@@ -12,7 +12,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
diff --git a/Demo/tkinter/matt/rubber-band-box-demo-1.py b/Demo/tkinter/matt/rubber-band-box-demo-1.py
index b00518e..66b8f8b 100644
--- a/Demo/tkinter/matt/rubber-band-box-demo-1.py
+++ b/Demo/tkinter/matt/rubber-band-box-demo-1.py
@@ -2,7 +2,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT',
diff --git a/Demo/tkinter/matt/rubber-line-demo-1.py b/Demo/tkinter/matt/rubber-line-demo-1.py
index 59b8bd9..b1c8e78 100644
--- a/Demo/tkinter/matt/rubber-line-demo-1.py
+++ b/Demo/tkinter/matt/rubber-line-demo-1.py
@@ -2,7 +2,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def createWidgets(self):
self.QUIT = Button(self, text='QUIT',
diff --git a/Demo/tkinter/matt/slider-demo-1.py b/Demo/tkinter/matt/slider-demo-1.py
index db6114b..5662db9 100644
--- a/Demo/tkinter/matt/slider-demo-1.py
+++ b/Demo/tkinter/matt/slider-demo-1.py
@@ -5,7 +5,7 @@ from Tkinter import *
class Test(Frame):
def print_value(self, val):
- print "slider now at", val
+ print("slider now at", val)
def reset(self):
self.slider.set(0)
diff --git a/Demo/tkinter/matt/subclass-existing-widgets.py b/Demo/tkinter/matt/subclass-existing-widgets.py
index 0e08f92..fc04859 100644
--- a/Demo/tkinter/matt/subclass-existing-widgets.py
+++ b/Demo/tkinter/matt/subclass-existing-widgets.py
@@ -5,7 +5,7 @@ from Tkinter import *
class New_Button(Button):
def callback(self):
- print self.counter
+ print(self.counter)
self.counter = self.counter + 1
def createWidgets(top):
diff --git a/Demo/tkinter/matt/two-radio-groups.py b/Demo/tkinter/matt/two-radio-groups.py
index 9fd8f4f..52513ba 100644
--- a/Demo/tkinter/matt/two-radio-groups.py
+++ b/Demo/tkinter/matt/two-radio-groups.py
@@ -75,9 +75,9 @@ def makeFlavors(var):
def printStuff():
- print "party is", party.get()
- print "flavor is", flavor.get()
- print
+ print("party is", party.get())
+ print("flavor is", flavor.get())
+ print()
#################################################
#### Main starts here ...
diff --git a/Demo/tkinter/matt/window-creation-more.py b/Demo/tkinter/matt/window-creation-more.py
index eb0eb6f..3a4ce19 100644
--- a/Demo/tkinter/matt/window-creation-more.py
+++ b/Demo/tkinter/matt/window-creation-more.py
@@ -5,7 +5,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def makeWindow(self):
fred = Toplevel()
diff --git a/Demo/tkinter/matt/window-creation-simple.py b/Demo/tkinter/matt/window-creation-simple.py
index c990ed9..fdf1dcc 100644
--- a/Demo/tkinter/matt/window-creation-simple.py
+++ b/Demo/tkinter/matt/window-creation-simple.py
@@ -4,7 +4,7 @@ from Tkinter import *
class Test(Frame):
def printit(self):
- print "hi"
+ print("hi")
def makeWindow(self):
fred = Toplevel()
diff --git a/Demo/tkinter/matt/window-creation-w-location.py b/Demo/tkinter/matt/window-creation-w-location.py
index 9f23bac..af6f876 100644
--- a/Demo/tkinter/matt/window-creation-w-location.py
+++ b/Demo/tkinter/matt/window-creation-w-location.py
@@ -9,9 +9,9 @@ import sys
class QuitButton(Button):
def __init__(self, master, *args, **kwargs):
- if not kwargs.has_key("text"):
+ if "text" not in kwargs:
kwargs["text"] = "QUIT"
- if not kwargs.has_key("command"):
+ if "command" not in kwargs:
kwargs["command"] = master.quit
Button.__init__(self, master, *args, **kwargs)