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


Groups > comp.lang.python > #61257

Re: [newbie] struggling wth tkinter

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'tutorial': 0.03; 'subject:: [': 0.04; 'importerror:': 0.07; 'mouse': 0.07; 'tkinter': 0.07; 'ide': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'extension.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'supplying': 0.16; 'traceback.': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'result.': 0.19; 'subject:] ': 0.20; 'import': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'example.': 0.24; 'finally,': 0.24; 'second': 0.26; 'code:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply- To:1': 0.27; 'rest': 0.29; 'dec': 0.30; "i'm": 0.30; 'work.': 0.31; 'code': 0.31; 'jean': 0.31; 'linux.': 0.31; 'file': 0.32; 'supposed': 0.32; 'running': 0.33; '(most': 0.33; 'guess': 0.33; 'skip:# 10': 0.33; 'could': 0.34; 'but': 0.35; 'version': 0.36; 'shows': 0.36; 'thanks': 0.36; "i'll": 0.36; 'should': 0.36; 'expected': 0.38; 'window': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'little': 0.38; 'anything': 0.39; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'remove': 0.60; 'dave': 0.60; 'tell': 0.60; 'introduced': 0.61; 'numbers': 0.61; 'received:173': 0.61; "you're": 0.61; 'complete': 0.62; 'name': 0.63; 'here': 0.66; 'believe': 0.68; 'popup': 0.84; 'received:fios.verizon.net': 0.84; 'angel': 0.91; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: [newbie] struggling wth tkinter
Date Sat, 07 Dec 2013 16:11:35 -0500
References <40121057-3c98-4f50-84b3-fd320fe2cedc@googlegroups.com> <40121057-3c98-4f50-84b3-fd320fe2cedc@googlegroups.com> <almarsoft.1101845216682379224@news.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-254-207.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
In-Reply-To <almarsoft.1101845216682379224@news.gmane.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3709.1386450711.18130.python-list@python.org> (permalink)
Lines 42
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1386450711 news.xs4all.nl 2899 [2001:888:2000:d::a6]:53762
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:61257

Show key headers only | View raw


On 12/7/2013 1:12 PM, Dave Angel wrote:
> On Sat, 7 Dec 2013 08:52:08 -0800 (PST), Jean Dubois
> <jeandubois314@gmail.com> wrote:
>> I'm trying to go through a tutorial on tkinter which has the code
> below as an example. The only thing I see when running it is a little
> popup with "Click mouse here to quit" which works as expected but always
> shows the following error-message.
>> However the "main" window which should let you enter the numbers is
> not shown.
>> This is the quit error message:
>> Traceback (most recent call last):
>>   File "./feet2meters.py", line 3, in <module>
>>     from tkinter import ttk
>> ImportError: cannot import name ttk

That is supposed to work.

>> This is the code:
>> #!/usr/bin/env python
>> from tkinter import *
>> from tkinter import ttk
>
> Thanks for supplying the complete traceback.  But you should also tell
> the python version and what OS.  I'll guess python 3.3 on Linux.
>
> Finally,  what version tk are you running?  These widgets were
> introduced in tk 8.5

In 8.4, they were in the Tile extension. I do not know if that will 
work. Better, probably, to upgrade.
>
> Since it failed on the second import, none of the rest of the code
> matters. However, since you're not running it from a terminal window,
> it's conceivable that your ide is affecting the result.

Until you are able to import ttk, I believe you could remove the import 
and all 'ttk.' appearances, as I do not see anything ttk-specific.


-- 
Terry Jan Reedy

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


Thread

[newbie] struggling wth tkinter Jean Dubois <jeandubois314@gmail.com> - 2013-12-07 08:52 -0800
  Re: [newbie] struggling wth tkinter Dave Angel <davea@davea.name> - 2013-12-07 13:12 -0500
    Re: [newbie] struggling wth tkinter Jean Dubois <jeandubois314@gmail.com> - 2013-12-07 23:40 -0800
      Re: [newbie] struggling wth tkinter Chris Angelico <rosuav@gmail.com> - 2013-12-08 18:49 +1100
        Re: [newbie] struggling wth tkinter Jean Dubois <jeandubois314@gmail.com> - 2013-12-08 01:15 -0800
  Re: [newbie] struggling wth tkinter Cousin Stanley <cousinstanley@gmail.com> - 2013-12-07 11:23 -0700
    Re: [newbie] struggling wth tkinter Jean Dubois <jeandubois314@gmail.com> - 2013-12-07 23:45 -0800
      Re: [newbie] struggling wth tkinter Dave Angel <davea@davea.name> - 2013-12-08 09:16 -0500
        Re: [newbie] struggling wth tkinter Jean Dubois <jeandubois314@gmail.com> - 2013-12-08 07:53 -0800
      Re: [newbie] struggling wth tkinter Cousin Stanley <cousinstanley@gmail.com> - 2013-12-08 07:16 -0700
  Re: [newbie] struggling wth tkinter Terry Reedy <tjreedy@udel.edu> - 2013-12-07 16:11 -0500
  Re: [newbie] struggling wth tkinter Christian Gollwitzer <auriocus@gmx.de> - 2013-12-08 09:10 +0100
    Re: [newbie] struggling wth tkinter Jean Dubois <jeandubois314@gmail.com> - 2013-12-08 00:57 -0800

csiph-web