Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'example:': 0.03; 'else:': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'sys': 0.07; 'tkinter': 0.07; 'wednesday,': 0.07; 'cest': 0.09; 'decision.': 0.09; 'lawrence': 0.09; 'oh,': 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; 'python': 0.11; 'language.': 0.14; 'easier.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'language': 0.16; 'wrote:': 0.18; 'module': 0.19; 'meant': 0.20; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; '2.x': 0.24; 'wednesday': 0.24; 'versions': 0.24; 'this:': 0.26; 'code:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'program,': 0.31; '>>>>': 0.31; 'layer': 0.31; 'way?': 0.31; 'run': 0.32; 'another': 0.32; 'url:python': 0.33; 'moment': 0.34; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'version': 0.36; 'picking': 0.36; 'done': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'should': 0.36; 'requirements': 0.37; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'helps': 0.61; 'url:3': 0.61; 'simple': 0.61; 'our': 0.64; 'charset:windows-1252': 0.65; 'between': 0.67; 'six': 0.68; '20,': 0.68; 'line,': 0.68; 'goal': 0.75; '2015': 0.84; 'batchelder': 0.84; 'complexity': 0.84; 'received:89': 0.85; 'differences': 0.93; 'have.': 0.93; 'realistic': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: No ttk in 2.7 Date: Wed, 20 May 2015 21:55:56 +0100 References: <87r3qbqlve.fsf@Equus.decebal.nl> <5e9aac07-e210-4eb5-a3d7-cfa37cb3f6ab@googlegroups.com> <414bf0ad-557d-4373-8452-ab089888225e@googlegroups.com> <87iobnqdxi.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-89-240-167-240.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <87iobnqdxi.fsf@Equus.decebal.nl> 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: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432155376 news.xs4all.nl 2862 [2001:888:2000:d::a6]:49107 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90985 On 20/05/2015 19:52, Cecil Westerhof wrote: > Op Wednesday 20 May 2015 18:47 CEST schreef Ned Batchelder: > >> On Wednesday, May 20, 2015 at 12:43:29 PM UTC-4, Ned Batchelder wrote: >>> On Wednesday, May 20, 2015 at 12:35:40 PM UTC-4, Cecil Westerhof wrote: >>>> I want to start playing with tkinter, but there are some >>>> differences between 2 and 3. For this I use at the moment the >>>> following code: import sys >>>> >>>> if sys.version_info[0] < 3: >>>> import Tkinter as tk >>>> import ttk >>>> else: >>>> import tkinter as tk >>>> from tkinter import ttk >>>> or can it better be done in another way? >>> >>> Are you sure you want this program to run under both 2.x and 3.x? >>> That will add a layer of complexity to your project. If your >>> goal is to learn how to use Tkinter, you might be better off just >>> picking one version of Python, and sticking with it. >>> >>> Deciding what versions of Python to support is not always a simple >>> decision. It should be based on a realistic assessment of who will >>> be using your program, and what requirements they will have. >>> >>> --Ned. >> >> Oh, and I meant to include this: if you *do* want to support both >> 2.x and 3.x, the six module can make it easier. It helps smooth over >> modules that have been moved. You can use this line, for example: >> >> from six.moves import tkinter_ttk as ttk > > Thanks for the tip. I will look into it. > https://docs.python.org/3/howto/pyporting.html -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence