Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Mark Lawrence Newsgroups: comp.lang.python Subject: Re: importing Date: Mon, 7 Mar 2016 21:37:28 +0000 Lines: 79 Message-ID: References: <56DDA44B.7040405@vanderhoff.org> <56DDB91D.3020006@vanderhoff.org> <56DDDF95.9040000@mrabarnett.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de luWOTznsrcimg5m/NsKORAsBa2EM3MPG+hXMi9BHuzZw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.05; 'mrab': 0.05; 'column': 0.07; 'padding': 0.07; 'docs.': 0.09; 'grid': 0.09; 'newest': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'replied': 0.09; 'rows': 0.09; 'separately': 0.09; 'span': 0.09; "(it's": 0.16; '(starting': 0.16; '2016': 0.16; '3.1.3': 0.16; 'add,': 0.16; 'columns': 0.16; 'help;': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'row': 0.16; 'select,': 0.16; 'tab,': 0.16; 'tabs': 0.16; 'url:html)': 0.16; 'wrote:': 0.16; 'obviously': 0.16; 'module,': 0.18; 'stick': 0.18; 'widget': 0.18; 'language': 0.19; '>>>': 0.20; 'lawrence': 0.22; 'tkinter': 0.22; 'visible': 0.22; 'am,': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'sort': 0.25; 'module': 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'header:X -Complaints-To:1': 0.26; 'van': 0.26; 'chris': 0.26; 'skip:" 20': 0.26; 'module.': 0.27; 'function': 0.28; 'boundary': 0.29; 'index,': 0.29; 'ago': 0.29; '(including': 0.30; 'too.': 0.30; 'work.': 0.30; 'code': 0.30; 'certainly': 0.30; 'guess': 0.31; 'option': 0.31; 'says': 0.32; 'language.': 0.32; 'possibly': 0.32; 'url:python': 0.33; 'case,': 0.34; 'recommended': 0.34; 'tue,': 0.34; 'running': 0.34; 'add': 0.34; 'lists': 0.34; 'direction': 0.35; 'identified': 0.35; 'options:': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'others.': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'thanks': 0.37; 'received:org': 0.37; 'version': 0.38; 'several': 0.38; 'to:addr:python.org': 0.40; 'mark': 0.40; 'still': 0.40; 'some': 0.40; 'url:3': 0.60; 'your': 0.60; 'charset:windows-1252': 0.62; 'linked': 0.63; 'to,': 0.63; 'minutes': 0.64; 'our': 0.64; 'mar': 0.65; '>>>>>': 0.66; 'detail.': 0.66; '**kw)': 0.84; 'chrisa': 0.84; 'identify,': 0.84; 'insert,': 0.84; 'pythonistas,': 0.84; 'url:tkinter': 0.84; 'url:ttk': 0.84; 'notebook': 0.96 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 80.234.129.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <56DDDF95.9040000@mrabarnett.plus.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:104257 On 07/03/2016 20:07, MRAB wrote: > On 2016-03-07 19:08, Mark Lawrence wrote: >> On 07/03/2016 17:38, Chris Angelico wrote: >>> On Tue, Mar 8, 2016 at 4:23 AM, Tony van der Hoff >>> 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 >>> >> >> As I happen to be playing with tkinter I was searching literally minutes >> ago for the way to put a grid onto a notebook tab. Regrettably the >> notebook grid is conspicious by its absence from the docs :( >> > It's in the tkinter.ttk docs: > > https://docs.python.org/3/library/tkinter.ttk.html > https://docs.python.org/3/library/tkinter.ttk.html#tkinter.ttk.Notebook lists add, forget, hide, identify, index, insert, select, tab, tabs and enable_traversal, but no grid, possibly others. yet:- >>> import tkinter.ttk >>> help(tkinter.ttk.Notebook.grid) Help on function grid_configure in module tkinter: grid_configure(self, cnf={}, **kw) Position a widget in the parent widget in a grid. Use as options: column=number - use cell identified with given column (starting with 0) columnspan=number - this widget will span several columns in=master - use master to contain this widget in_=master - see 'in' option description ipadx=amount - add internal padding in x direction ipady=amount - add internal padding in y direction padx=amount - add padding in x direction pady=amount - add padding in y direction row=number - use cell identified with given row (starting with 0) rowspan=number - this widget will span several rows sticky=NSEW - if cell is larger on which sides will this widget stick to the cell boundary -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence