Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'importerror:': 0.05; 'python3': 0.05; 'advice.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:2.7': 0.09; '2.7': 0.13; 'happy.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.16; 'first,': 0.20; 'tkinter': 0.22; 'try:': 0.22; 'import': 0.24; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.26; 'adjust': 0.33; 'to:addr:python-list': 0.35; 'follows:': 0.35; 'except': 0.36; 'subject:: ': 0.37; 'received:org': 0.38; 'things': 0.39; 'whatever': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'suggest,': 0.84; 'ttk': 0.84; 'ware': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Sturla Molden Subject: Re: No ttk in 2.7 Date: Thu, 21 May 2015 14:04:18 +0000 (UTC) References: <87r3qbqlve.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 66-184-11.connect.netcom.no User-Agent: NewsTap/4.0.1 (iPad) X-: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432217081 news.xs4all.nl 2864 [2001:888:2000:d::a6]:56980 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3043 X-Received-Body-CRC: 3131806239 Xref: csiph.com comp.lang.python:91007 Zachary Ware wrote: > The way I would do it is as follows: > > try: > import tkinter as tk > from tkinter import ttk > except ImportError: > import Tkinter as tk > import ttk > > If I may suggest, just write it in Python3 first, then when it does > what you want tack on whatever you need to make 2.7 happy. I find it > easier to do things that way, though you may find that the only thing > you have to adjust is the imports. This is a good advice. And yes, it is easier than most would think. Sturla