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


Groups > comp.lang.python > #65709

Re: Python 2.7.6 help with modules

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'broken': 0.04; 'say,': 0.05; 'subject:Python': 0.06; 'subject:help': 0.08; 'augmented': 0.09; 'bits': 0.09; 'objects,': 0.09; 'subject:modules': 0.09; 'cc:addr:python-list': 0.11; '"in': 0.16; '......': 0.16; 'assignment.': 0.16; 'assignments': 0.16; 'brightest': 0.16; 'clear.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'gonna': 0.16; 'i\xe2\x80\x99m': 0.16; 'mildly': 0.16; 'mutable': 0.16; 'nerds,': 0.16; 'say.': 0.16; 'wrote:': 0.18; 'things.': 0.19; 'feb': 0.22; '(in': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'recognize': 0.24; 'cc:2**0': 0.24; 'least': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; '[1]': 0.29; 'raise': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'evil': 0.31; 'lot.': 0.31; 'anyone': 0.31; 'figure': 0.32; 'weeks': 0.32; 'open': 0.33; 'up.': 0.33; 'alone': 0.33; '"the': 0.34; "i'd": 0.34; 'could': 0.34; 'subject:with': 0.35; 'case,': 0.35; "who's": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'described': 0.36; 'done,': 0.36; 'right?': 0.36; 'half': 0.37; 'seconds': 0.37; 'being': 0.38; 'pm,': 0.38; 'von': 0.38; 'that,': 0.38; 'sure': 0.39; 'enough': 0.39; 'how': 0.40; 'most': 0.60; 'simple': 0.61; "you're": 0.61; 'first': 0.61; 'back': 0.62; "you'll": 0.62; 'our': 0.64; 'movie': 0.65; 'talking': 0.65; 'book,': 0.68; 'nobody': 0.68; 'sound': 0.68; 'power': 0.76; '2014,': 0.84; 'film,': 0.84; 'i\xe2\x80\x99ll': 0.84; 'much,': 0.84; 'music,': 0.84; 'sight': 0.84; 'captain': 0.91; 'dozen': 0.91; 'maria': 0.91; 'to:none': 0.92; 'children.': 0.93; 'differences': 0.93; 'scott': 0.93
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 :content-type:content-transfer-encoding; bh=H9ycL+BeGJdnjuhcBYekBx6LhZgCNMEIif5ZIm50IxU=; b=XqNLUptcnB+UVDJBE5v/LCzTEtr3dpPtWMB6vQJGAQC/SrnsjWXSQBzrCoQJJ3ZxIg +maYBOmGKFJJ1Rnqp4tilz/uyF7YEeNcvs89+ZAdmadrm20h2jDF2xuKuq2I9pQ+meiI W+oCSGdR37UDS3uXOTkcKPBjOu8gXiZ7yM3LY2q355sBuCns8Fm5NNelgmkQCUron4u/ EQOTz3E7mS32fkSGC6ghrxwtVDmK9OpQVVwgVZ4AYB4Y9Wj9KLhm0wKFNwrgnD/P0lVz mf3AkkksLiG/NXJ2cPyeypQOOuSfeK5mXn6FHmTdwKu30qLs7c2pG5aTUN+ClRQsgY17 970A==
MIME-Version 1.0
X-Received by 10.66.129.133 with SMTP id nw5mr17086373pab.98.1391912092465; Sat, 08 Feb 2014 18:14:52 -0800 (PST)
In-Reply-To <B28E6898-EC64-4065-B1D7-4099A0B6715F@cox.net>
References <032F2E23-6983-4710-B087-C1771B66C3EF@cox.net> <635C857D-1F7A-4F95-B3A7-F1A3C69BF137@cox.net> <1DA52F3B-CE00-4E47-BE84-C07482966FD7@cox.net> <B28E6898-EC64-4065-B1D7-4099A0B6715F@cox.net>
Date Sun, 9 Feb 2014 13:14:52 +1100
Subject Re: Python 2.7.6 help with modules
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
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.6560.1391912096.18130.python-list@python.org> (permalink)
Lines 59
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391912096 news.xs4all.nl 2886 [2001:888:2000:d::a6]:59930
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65709

Show key headers only | View raw


On Sun, Feb 9, 2014 at 1:07 PM, Scott W Dunning <swdunning@cox.net> wrote:
>
> On Feb 8, 2014, at 6:46 PM, Chris Angelico <rosuav@gmail.com> wrote:
>
> I had no idea
> that, in a group of half a dozen nerds, nobody would recognize this
> broken text: "In brightest day, in blackest night / No evil ......
> sight / Let .... worship .... mi.... / .... my power .... tern...." -
> I'd have thought the first line alone would be enough for anyone who's
> at least mildly nerdy and/or geeky.)
>
> Green Lantern oath right?

Correct! (In this particular case, they were facing a magically-locked
vault; by shining a green light on it - say, from a candle inside a
green bottle - they could see how to open it.)

> You'll also note that you're trimming off bits and leaving "residual
> seconds". I would put all the "_rem" values back into "seconds", which
> would let you use augmented assignment:
>
>
> Not sure what augmented assignments are but I’ll look that up.  I’m gonna
> try and figure it out that way also just for the heck of it.
>
>
> weeks = seconds/604800
> seconds %= 604800
>
>
> Is the ->  seconds %= 604800
> Saying ->  seconds = seconds % 604800?

Pretty much, yeah. If you think about it in English as "Divide seconds
by 604800", most people will think that "seconds" will end up smaller;
so that's represented by augmented assignment. There are also some
optimizations that can be done, and some differences as regards
mutable objects, but with simple arithmetic, it's what you say.

> [1] Our father's not a captain, but there's still nothing about being
> a non-captain with seven children. And that movie is definitely one of
> our favorite things.
>
>
> Seven children is a lot.  It definitely takes a Captain to raise seven
> children.  : )
>

Not sure if you're familiar with the book, musical, or film, "The
Sound of Music", about Captain von Trapp and Maria and their children.
Maria sings (in the film) "A captain with seven children - what's so
fearsome about that?", and somehow my fingers left out the key word
"fearsome" in the above reference, which doesn't make it very clear.
There's nothing *fearsome* about being a non-captain, etc. Also, now
that you know I'm talking about the Sound of Music, you'll know why I
described it as one of our favorite things. :)

ChrisA

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


Thread

Re: Python 2.7.6 help with modules Chris Angelico <rosuav@gmail.com> - 2014-02-09 13:14 +1100

csiph-web