Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #91007

Re: No ttk in 2.7

From Sturla Molden <sturla.molden@gmail.com>
Subject Re: No ttk in 2.7
Date 2015-05-21 14:04 +0000
References <87r3qbqlve.fsf@Equus.decebal.nl> <CAKJDb-OK3CjC5ytF7y3ALXkW8rJ=rXHrDKx3NHXfuaapC9Y=Rw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.198.1432217081.17265.python-list@python.org> (permalink)

Show all headers | View raw


Zachary Ware <zachary.ware+pylist@gmail.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

No ttk in 2.7 Cecil Westerhof <Cecil@decebal.nl> - 2015-05-20 18:01 +0200
  Re: No ttk in 2.7 Ned Batchelder <ned@nedbatchelder.com> - 2015-05-20 09:43 -0700
    Re: No ttk in 2.7 Ned Batchelder <ned@nedbatchelder.com> - 2015-05-20 09:47 -0700
      Re: No ttk in 2.7 Cecil Westerhof <Cecil@decebal.nl> - 2015-05-20 20:52 +0200
        Re: No ttk in 2.7 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-20 21:55 +0100
    Re: No ttk in 2.7 Cecil Westerhof <Cecil@decebal.nl> - 2015-05-20 20:51 +0200
  Re: No ttk in 2.7 Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-05-20 12:03 -0500
    Re: No ttk in 2.7 Cecil Westerhof <Cecil@decebal.nl> - 2015-05-20 20:54 +0200
      Re: No ttk in 2.7 Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-20 13:30 -0600
  Re: No ttk in 2.7 Sturla Molden <sturla.molden@gmail.com> - 2015-05-21 14:04 +0000

csiph-web