82ab75a
diff -up snack2.2.10/demos/python/dataCmd.py.py3 snack2.2.10/demos/python/dataCmd.py
82ab75a
--- snack2.2.10/demos/python/dataCmd.py.py3	2018-10-04 15:46:14.974999306 -0400
82ab75a
+++ snack2.2.10/demos/python/dataCmd.py	2018-10-04 15:46:50.295216897 -0400
82ab75a
@@ -1,7 +1,12 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 # -*- coding: iso-8859-1 -*-
82ab75a
 
82ab75a
-import Tkinter
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    import Tkinter
82ab75a
+else:
82ab75a
+    import tkinter as Tkinter
82ab75a
+
82ab75a
 import tkSnack
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/echo.py.py3 snack2.2.10/demos/python/echo.py
82ab75a
--- snack2.2.10/demos/python/echo.py.py3	2018-10-04 15:46:59.535012224 -0400
82ab75a
+++ snack2.2.10/demos/python/echo.py	2018-10-04 15:47:37.093180236 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/generator.py.py3 snack2.2.10/demos/python/generator.py
82ab75a
--- snack2.2.10/demos/python/generator.py.py3	2018-10-04 15:47:47.332953411 -0400
82ab75a
+++ snack2.2.10/demos/python/generator.py	2018-10-04 15:48:06.435530261 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/MinSect.py.py3 snack2.2.10/demos/python/MinSect.py
82ab75a
--- snack2.2.10/demos/python/MinSect.py.py3	2018-10-04 15:48:16.444308540 -0400
82ab75a
+++ snack2.2.10/demos/python/MinSect.py	2018-10-04 15:48:45.907655882 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/MinSpeg.py.py3 snack2.2.10/demos/python/MinSpeg.py
82ab75a
--- snack2.2.10/demos/python/MinSpeg.py.py3	2018-10-04 15:48:57.586397173 -0400
82ab75a
+++ snack2.2.10/demos/python/MinSpeg.py	2018-10-04 15:49:16.562976809 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/MinWave.py.py3 snack2.2.10/demos/python/MinWave.py
82ab75a
--- snack2.2.10/demos/python/MinWave.py.py3	2018-10-04 15:49:26.578754945 -0400
82ab75a
+++ snack2.2.10/demos/python/MinWave.py	2018-10-04 15:49:39.057478518 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/mixplay.py.py3 snack2.2.10/demos/python/mixplay.py
82ab75a
--- snack2.2.10/demos/python/mixplay.py.py3	2018-10-04 15:49:49.602244931 -0400
82ab75a
+++ snack2.2.10/demos/python/mixplay.py	2018-10-04 15:50:04.440916236 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/notescale.py.py3 snack2.2.10/demos/python/notescale.py
82ab75a
--- snack2.2.10/demos/python/notescale.py.py3	2018-10-04 15:50:13.624712803 -0400
82ab75a
+++ snack2.2.10/demos/python/notescale.py	2018-10-04 15:50:30.640335876 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/oggplay.py.py3 snack2.2.10/demos/python/oggplay.py
82ab75a
--- snack2.2.10/demos/python/oggplay.py.py3	2018-10-04 15:50:40.330121229 -0400
82ab75a
+++ snack2.2.10/demos/python/oggplay.py	2018-10-04 15:51:35.127907369 -0400
82ab75a
@@ -5,8 +5,13 @@
82ab75a
 # Note: this script will also play audio files in any other format supported
82ab75a
 # by tkSnack
82ab75a
 
82ab75a
+from __future__ import print_function
82ab75a
 import sys
82ab75a
-from Tkinter import *
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 initializeSnack(Tkinter.Tk())
82ab75a
@@ -19,4 +24,4 @@ if sys.argv[1:]:
82ab75a
 	snd = Sound(file=sys.argv[1])
82ab75a
 	snd.play(blocking=1)
82ab75a
 else:
82ab75a
-	print "Usage: oggplay.py file.ogg"
82ab75a
+	print("Usage: oggplay.py file.ogg")
82ab75a
diff -up snack2.2.10/demos/python/playnotes.py.py3 snack2.2.10/demos/python/playnotes.py
82ab75a
--- snack2.2.10/demos/python/playnotes.py.py3	2018-10-04 15:51:44.431701277 -0400
82ab75a
+++ snack2.2.10/demos/python/playnotes.py	2018-10-04 15:52:01.623320444 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/polarspec.py.py3 snack2.2.10/demos/python/polarspec.py
82ab75a
--- snack2.2.10/demos/python/polarspec.py.py3	2018-10-04 15:52:11.479102123 -0400
82ab75a
+++ snack2.2.10/demos/python/polarspec.py	2018-10-04 15:52:24.654810263 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 from math import *
82ab75a
 
82ab75a
diff -up snack2.2.10/demos/python/spectrogram.py.py3 snack2.2.10/demos/python/spectrogram.py
82ab75a
--- snack2.2.10/demos/python/spectrogram.py.py3	2018-10-04 15:52:35.462570856 -0400
82ab75a
+++ snack2.2.10/demos/python/spectrogram.py	2018-10-04 15:52:49.101268729 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/demos/python/sphere.py.py3 snack2.2.10/demos/python/sphere.py
82ab75a
--- snack2.2.10/demos/python/sphere.py.py3	2018-10-04 15:52:57.679078718 -0400
82ab75a
+++ snack2.2.10/demos/python/sphere.py	2018-10-04 15:53:36.557217499 -0400
82ab75a
@@ -1,6 +1,12 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+from __future__ import print_function
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
@@ -15,11 +21,11 @@ snd = Sound()
82ab75a
 
82ab75a
 file = 'test.sph'
82ab75a
 
82ab75a
-print 'reading sphere file \'%s\'' % file
82ab75a
+print('reading sphere file \'%s\'' % file)
82ab75a
 snd.read(file)
82ab75a
 
82ab75a
-print 'playing file \'%s\'' % file
82ab75a
+print('playing file \'%s\'' % file)
82ab75a
 snd.play(blocking=1)
82ab75a
 
82ab75a
-print 'writing wav file \'%s\'' % file
82ab75a
+print('writing wav file \'%s\'' % file)
82ab75a
 snd.write('new.wav')
82ab75a
diff -up snack2.2.10/demos/python/tkSnack.py.py3 snack2.2.10/demos/python/tkSnack.py
82ab75a
--- snack2.2.10/demos/python/tkSnack.py.py3	2018-10-04 15:53:45.815012427 -0400
82ab75a
+++ snack2.2.10/demos/python/tkSnack.py	2018-10-04 15:56:03.873998084 -0400
82ab75a
@@ -7,8 +7,14 @@ by Kevin Russell and Kare Sjolander
82ab75a
 last modified: Mar 28, 2003
82ab75a
 """
82ab75a
 
82ab75a
-import Tkinter
82ab75a
-import types
82ab75a
+from __future__ import print_function
82ab75a
+
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    import Tkinter
82ab75a
+else:
82ab75a
+    import tkinter as Tkinter
82ab75a
+
82ab75a
 import string
82ab75a
 
82ab75a
 Tkroot = None
82ab75a
@@ -20,7 +26,8 @@ def initializeSnack(newroot):
82ab75a
     Tkroot = newroot
82ab75a
     Tkroot.tk.call('eval', 'package require snack')
82ab75a
     Tkroot.tk.call('snack::createIcons')
82ab75a
-    Tkroot.tk.call('snack::setUseOldObjAPI')
82ab75a
+    if sys.version_info[0] == 2:
82ab75a
+        Tkroot.tk.call('snack::setUseOldObjAPI')
82ab75a
     audio = AudioControllerSingleton()
82ab75a
     mixer = MixerControllerSingleton()
82ab75a
 
82ab75a
@@ -92,7 +99,7 @@ class TkObject:
82ab75a
                 self.tk.call(self.name, 'configure')):
82ab75a
                 cnf[x[0][1:]] = (x[0][1:],) + x[1:]
82ab75a
                 return cnf
82ab75a
-        if type(cnf) is types.StringType:
82ab75a
+        if isinstance(cnf, str):
82ab75a
             x = self.tk.split(self.tk.call(self.name, 'configure', '-'+cnf))
82ab75a
             return (x[0][1:],) + x[1:]
82ab75a
         self.tk.call((self.name, 'configure') + self._options(cnf))
82ab75a
@@ -124,8 +131,7 @@ class Sound (TkObject):
82ab75a
             if Tkroot:
82ab75a
                 master = Tkroot
82ab75a
             else:
82ab75a
-                raise RuntimeError, \
82ab75a
-                      'Tk not intialized or not registered with Snack'
82ab75a
+                raise RuntimeError('Tk not intialized or not registered with Snack')
82ab75a
         self.tk = master.tk
82ab75a
         if not name:
82ab75a
             self.name = self.tk.call(('sound',) + self._options(kw))
82ab75a
@@ -409,8 +415,7 @@ class Filter(TkObject):
82ab75a
         if Tkroot:
82ab75a
             master = Tkroot
82ab75a
         else:
82ab75a
-            raise RuntimeError, \
82ab75a
-                 'Tk not intialized or not registered with Snack'
82ab75a
+            raise RuntimeError('Tk not intialized or not registered with Snack'
82ab75a
         self.tk = master.tk
82ab75a
         self.name = self.tk.call(('snack::filter', name) + args +
82ab75a
                                  self._options(kw))
82ab75a
@@ -537,7 +542,7 @@ class SoundFrame(Tkinter.Frame):
82ab75a
         self.sound.record()
82ab75a
         
82ab75a
     def info(self):
82ab75a
-        print self.sound.info()
82ab75a
+        print(self.sound.info())
82ab75a
         
82ab75a
 def createSpectrogram(canvas, *args, **kw):
82ab75a
     """Draws a spectrogram of a sound on canvas."""
82ab75a
diff -up snack2.2.10/demos/python/widget.py.py3 snack2.2.10/demos/python/widget.py
82ab75a
--- snack2.2.10/demos/python/widget.py.py3	2018-10-04 15:56:11.263837964 -0400
82ab75a
+++ snack2.2.10/demos/python/widget.py	2018-10-04 15:56:28.360467507 -0400
82ab75a
@@ -1,6 +1,11 @@
82ab75a
 #! /usr/bin/env python
82ab75a
 
82ab75a
-from Tkinter import *
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    from Tkinter import *
82ab75a
+else:
82ab75a
+    from tkinter import *
82ab75a
+
82ab75a
 from tkSnack import *
82ab75a
 
82ab75a
 root = Tkinter.Tk()
82ab75a
diff -up snack2.2.10/python/tkSnack.py.py3 snack2.2.10/python/tkSnack.py
82ab75a
--- snack2.2.10/python/tkSnack.py.py3	2018-10-04 15:56:37.537268660 -0400
82ab75a
+++ snack2.2.10/python/tkSnack.py	2018-10-04 15:58:47.358455670 -0400
82ab75a
@@ -7,8 +7,14 @@ by Kevin Russell and Kare Sjolander
82ab75a
 last modified: Mar 28, 2003
82ab75a
 """
82ab75a
 
82ab75a
-import Tkinter
82ab75a
-import types
82ab75a
+from __future__ import print_function
82ab75a
+
82ab75a
+import sys
82ab75a
+if sys.version_info[0] == 2:
82ab75a
+    import Tkinter
82ab75a
+else:
82ab75a
+    import tkinter as Tkinter
82ab75a
+
82ab75a
 import string
82ab75a
 
82ab75a
 Tkroot = None
82ab75a
@@ -20,7 +26,8 @@ def initializeSnack(newroot):
82ab75a
     Tkroot = newroot
82ab75a
     Tkroot.tk.call('eval', 'package require snack')
82ab75a
     Tkroot.tk.call('snack::createIcons')
82ab75a
-    Tkroot.tk.call('snack::setUseOldObjAPI')
82ab75a
+    if sys.version_info[0] == 2:
82ab75a
+        Tkroot.tk.call('snack::setUseOldObjAPI')
82ab75a
     audio = AudioControllerSingleton()
82ab75a
     mixer = MixerControllerSingleton()
82ab75a
 
82ab75a
@@ -92,7 +99,7 @@ class TkObject:
82ab75a
                 self.tk.call(self.name, 'configure')):
82ab75a
                 cnf[x[0][1:]] = (x[0][1:],) + x[1:]
82ab75a
                 return cnf
82ab75a
-        if type(cnf) is types.StringType:
82ab75a
+        if isinstance(cnf, str):
82ab75a
             x = self.tk.split(self.tk.call(self.name, 'configure', '-'+cnf))
82ab75a
             return (x[0][1:],) + x[1:]
82ab75a
         self.tk.call((self.name, 'configure') + self._options(cnf))
82ab75a
@@ -124,8 +131,7 @@ class Sound (TkObject):
82ab75a
             if Tkroot:
82ab75a
                 master = Tkroot
82ab75a
             else:
82ab75a
-                raise RuntimeError, \
82ab75a
-                      'Tk not intialized or not registered with Snack'
82ab75a
+                raise RuntimeError('Tk not intialized or not registered with Snack')
82ab75a
         self.tk = master.tk
82ab75a
         if not name:
82ab75a
             self.name = self.tk.call(('sound',) + self._options(kw))
82ab75a
@@ -409,8 +415,7 @@ class Filter(TkObject):
82ab75a
         if Tkroot:
82ab75a
             master = Tkroot
82ab75a
         else:
82ab75a
-            raise RuntimeError, \
82ab75a
-                 'Tk not intialized or not registered with Snack'
82ab75a
+            raise RuntimeError('Tk not intialized or not registered with Snack')
82ab75a
         self.tk = master.tk
82ab75a
         self.name = self.tk.call(('snack::filter', name) + args +
82ab75a
                                  self._options(kw))
82ab75a
@@ -537,7 +542,7 @@ class SoundFrame(Tkinter.Frame):
82ab75a
         self.sound.record()
82ab75a
         
82ab75a
     def info(self):
82ab75a
-        print self.sound.info()
82ab75a
+        print(self.sound.info())
82ab75a
         
82ab75a
 def createSpectrogram(canvas, *args, **kw):
82ab75a
     """Draws a spectrogram of a sound on canvas."""