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


Groups > comp.lang.python > #104234

Re: importing

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: importing
Date Tue, 8 Mar 2016 04:38:27 +1100
Lines 33
Message-ID <mailman.35.1457372310.10335.python-list@python.org> (permalink)
References <56DDA44B.7040405@vanderhoff.org> <CAPTjJmpAaefgSA+YKm45A4ucuEgjPgL+XmugS22oFB_1ZccGxQ@mail.gmail.com> <56DDB91D.3020006@vanderhoff.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de 2HY3Vhc7NXv7uBSvOdlJQQaVhE4xSVJiSI5k/7XZCQCA==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'docs.': 0.09; 'newest': 0.09; 'replied': 0.09; 'separately': 0.09; "(it's": 0.16; '2016': 0.16; '3.1.3': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'help;': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'url:html)': 0.16; 'wrote:': 0.16; 'obviously': 0.16; 'module,': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'tkinter': 0.22; 'visible': 0.22; 'am,': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'sort': 0.25; "doesn't": 0.26; 'van': 0.26; 'chris': 0.26; 'skip:" 20': 0.26; 'message-id:@mail.gmail.com': 0.27; 'module.': 0.27; '(including': 0.30; 'too.': 0.30; 'work.': 0.30; 'code': 0.30; 'certainly': 0.30; 'guess': 0.31; 'says': 0.32; 'url:python': 0.33; 'case,': 0.34; 'recommended': 0.34; 'tue,': 0.34; 'running': 0.34; 'lists': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'others.': 0.36; 'url:library': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'thanks': 0.37; 'version': 0.38; 'received:209': 0.38; 'still': 0.40; 'some': 0.40; 'url:3': 0.60; 'your': 0.60; 'linked': 0.63; 'to,': 0.63; 'mar': 0.65; 'detail.': 0.66; 'chrisa': 0.84; 'url:tkinter': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=/7OTse8MnlAqYfULg44xKqIb8HAsf/xEoKJB3F2LotM=; b=Ku52wBiqHwgNItuhHcXSU5JHv6mRbqRtrkRIDXV8oeki0Jg4ovCPlz0gr3e7uSYXmy 0GG4ZEs/nKkDyjWdlM7TOP+k65zOd+lP7zalUAzpfJN/ivl8ACrt1C0pgGJe4otXdB2/ YttNK6icZZRdtGFjLh4fIQPef0EA/XECCeIIUwQOJyzqjP9brWu4Ch/GAaUAwpE6FKay 1D1KL3SaFG7RWeMlyyq4FrzIFljWWeQQrQAeMiVG9YfzswTYMRdJJqwyPTkcZTxqwDGE W6VCiOqI/26tYRu8yAB2/EH1Gt8hRjfnjAlIAcfZT+PlaAV51kgwWvYwsZ42oopXDHPm ZVBQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=/7OTse8MnlAqYfULg44xKqIb8HAsf/xEoKJB3F2LotM=; b=enVjN9strMRNdpKXk8SLwinFnmweVCpbbkSVyeRLwSOg+PVKgXuhJBnOxe5QqHUdWO mkYXdJ5KpKYeMfCJnDu7PJLqitSEwVKjHh+lW+IntsX9AcrXYa8MmF9mQQuLNouaYWaZ t89mUhaFTj10pDheuSsud6/iGqvVXGPd+kfv2u2KevrSSvZwdLBWBMrjcX5Pl8sM720X 31i+TBwa/wRiwNdnEbLFALBagNjNl3GPyLt5o/kc6cTq8ETLgMo+eZk3xexuU/QwKX9Z cInFuRS3M5khmIVVpkwrUWhT//tvn2YVbxGBziqN3FbBkdmtHmWTjOvKTkVsiT0orwyC jZDA==
X-Gm-Message-State AD7BkJLMzLuNrkhULsG6KMGuxSOX/1J3Z1Y04v0biSmQAirfvYPe0xaqX+BzuKlcvKxl2O1b4Xz6aW1l+UBNTA==
X-Received by 10.107.63.137 with SMTP id m131mr20413606ioa.157.1457372307865; Mon, 07 Mar 2016 09:38:27 -0800 (PST)
In-Reply-To <56DDB91D.3020006@vanderhoff.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
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>
Xref csiph.com comp.lang.python:104234

Show key headers only | View raw


On Tue, Mar 8, 2016 at 4:23 AM, Tony van der Hoff <tony@vanderhoff.org> wrote:
> Thanks to all who replied to my cry for help; I understand it better now.
> But:
>
> On 07/03/16 16:08, Chris Angelico wrote:
>>
>>
>> The documentation should tell you what you need to import to make
>> something work. In this case, I would guess that "import
>> tkinter.messagebox" or "from tkinter import messagebox" would be the
>> recommended way to use this module.
>
>
> Well, I found the tkinter documentation to be sparse in the extreme
> (https://docs.python.org/release/3.1.3/library/tkinter.html), and it
> certainly doesn't go into that sort of detail.

You're looking at an ancient version of the docs. Here's the newest docs:

https://docs.python.org/3/library/tkinter.html

Up the top, it says to start with "import tkinter" or "from tkinter
import *", and then it lists some *other modules* (including
"tkinter.messagebox"). Obviously with the "turtle" module, you have to
import that separately (it's completely outside the tkinter
hierarchy); the same is true of the others.

Incidentally, this message is visible in the 3.1.3 docs that you
linked to, too. But I still recommend reading the current docs (unless
you're actually running your code on 3.1.3, in which case you really
REALLY should upgrade).

ChrisA

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


Thread

Re: importing Chris Angelico <rosuav@gmail.com> - 2016-03-08 04:38 +1100

csiph-web