ttk utilisation

petit bout de code qui import les librairies ttk et tkinter suivant la version de python installée

import os
import os.path

import sys

py26 = py30 = py31 = False
version = sys.hexversion
if version >= 0x020600F0 and version < 0x020700F0 :
    py26 = True
    from Tkinter import *
    import ttk
elif version >= 0x03000000 and version < 0x03010000 :
    py30 = True
    from tkinter import *
    import ttk
elif version >= 0x03010000:
    py31 = True
    from tkinter import *
    import tkinter.ttk as ttk
else:
    print ("""
    You do not have a version of python supporting ttk widgets..
    You need a version >= 2.6 to execute PAGE modules.
    """)
    sys.exit()