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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; 'completeness': 0.07; 'smallest': 0.07; 'subject:help': 0.08; 'formatting': 0.09; 'instance.': 0.09; 'subject:modules': 0.09; 'suppress': 0.09; 'weeks,': 0.09; 'cc:addr:python-list': 0.11; '(mainly': 0.16; '23,': 0.16; '365': 0.16; 'display,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'seconds,': 0.16; 'seconds.': 0.16; 'wrote:': 0.18; 'split': 0.19; 'work,': 0.20; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'days,': 0.24; 'hours,': 0.24; 'lets': 0.24; 'cc:2**0': 0.24; 'mention': 0.26; 'purposes': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; '[1]': 0.29; 'unix': 0.29; 'message-id:@mail.gmail.com': 0.30; 'largest': 0.30; "i'm": 0.30; 'went': 0.31; 'code': 0.31; 'libraries': 0.31; "they'll": 0.31; 'weeks': 0.32; "we're": 0.32; 'maybe': 0.34; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'minutes,': 0.36; 'method': 0.36; 'possible': 0.36; 'similar': 0.36; 'seconds': 0.37; 'wrong': 0.37; 'two': 0.37; 'same.': 0.38; 'pm,': 0.38; 'aside': 0.39; 'either': 0.39; 'how': 0.40; 'read': 0.60; 'mentioned': 0.61; 'simply': 0.61; 'back': 0.62; "you'll": 0.62; 'show': 0.63; 'field': 0.63; 'different': 0.65; 'minutes': 0.67; '2014,': 0.84; 'exercise,': 0.84; 'happened.': 0.84; 'heh.': 0.84; 'i\xe2\x80\x99ll': 0.84; 'to:none': 0.92; '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=5jp+eBp7vbMBvQWrgCdFugzRJDr0zRXIbDe55yhasgU=; b=Nat744CosUh8C0Xpa4WaD66SmW5RPxXjphAMUSrSjxF0CZi1k0sho2M6I2W3avPoyA Vn3E7MGSdQMPEdEhjzSAaVMbE/1VIAjZo1lwG4eAZbmhZ+nmMUvERnl/acIAy1fHi4xH nnGpoY3R6M9H435LLdCC5pgeLSNDrz8TZd1hyjTaZBLOZMySG/wSPnupS9whcHVbS+Iz a8Rj1FkLe9ledEk7o/K3QJZ32ZBIDFp5AOj8uNOfS3PJoPya+qeSW525tkk5t+n3goi4 tpR34oJYjek8frf6JEjZLNNhb4/LvQfqNow2yAh/k2YMyzB1UT08CmFaJ+xhM1xyjtsV E1hA== MIME-Version: 1.0 X-Received: by 10.66.26.176 with SMTP id m16mr375847pag.142.1391910601777; Sat, 08 Feb 2014 17:50:01 -0800 (PST) In-Reply-To: <8C13948E-1A2A-4221-89D3-C117B4A10F78@cox.net> References: <032F2E23-6983-4710-B087-C1771B66C3EF@cox.net> <635C857D-1F7A-4F95-B3A7-F1A3C69BF137@cox.net> <07C379F9-3BD4-4DC4-8FEF-BA3B0067A7B1@cox.net> <8C13948E-1A2A-4221-89D3-C117B4A10F78@cox.net> Date: Sun, 9 Feb 2014 12:50:01 +1100 Subject: Re: Python 2.7.6 help with modules From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391910605 news.xs4all.nl 2843 [2001:888:2000:d::a6]:48609 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65705 On Sun, Feb 9, 2014 at 12:46 PM, Scott W Dunning wrote: > On Feb 8, 2014, at 5:56 PM, Chris Angelico wrote: >> >> Carry on with that method - work out the number of minutes, and then >> the "hours_etc" which has the rest. Then do the same to split off >> hours, and then days. See how you go! > > I did it similar to that but I went backwards. I started with number of = weeks and went down to seconds remaining. Would the result still be the sa= me if the order of the code went the other way (i.e.. from minutes to weeks= instead of the way I did it from weeks to seconds)? > The result will be the same. You can work either way. Working from the smallest up lets you work in different formats - maybe you want to suppress "0 weeks, 0 days" if it's less than a day, for instance. Working from the largest down means you can simply write things out as you get them, and they'll be in the right order for a human to read (look back up to my aside where I show assembly-language number display, and you'll see that the digits come out in the wrong order). >> [1] For the purposes of this exercise, I'm pretending that this is >> Unix time and has no leap seconds. Technically, when you write out >> HH:MM:SS, the HH field can go from 00 to 23, the MM field can go from >> 00 to 59, and the SS field can go from 00 to 61 - yes, it's possible >> to have *two* consecutive leap seconds, although this has never yet >> happened. But for this, we're working in a system that has seconds >> going from 00 to 59 > > > I honestly do not know what leap seconds are but I=E2=80=99ll take your w= ord for it. lol Heh. I mentioned them for completeness only. Look 'em up on Wikipedia if you like; some years are a smidge longer than 365 or 366 days, by either one or two seconds. Almost NEVER significant to every-day work, but you'll see some time formatting libraries that mention them (mainly because the SS field can go up to 61). ChrisA