Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65708
| Subject | Re: Python 2.7.6 help with modules |
|---|---|
| From | Scott W Dunning <swdunning@cox.net> |
| Date | 2014-02-08 19:07 -0700 |
| References | <032F2E23-6983-4710-B087-C1771B66C3EF@cox.net> <635C857D-1F7A-4F95-B3A7-F1A3C69BF137@cox.net> <1DA52F3B-CE00-4E47-BE84-C07482966FD7@cox.net> <Q1oo1n00J3bjUJS011opN8> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.6559.1391911642.18130.python-list@python.org> (permalink) |
[Multipart message — attachments visible in raw view] - view raw
On Feb 8, 2014, at 6:46 PM, Chris Angelico <rosuav@gmail.com> wrote: > No, I'm not a teacher by profession, but I was homeschooled, and since > I'm the second of seven children [1], I got used to teaching things to > my siblings. Also, every week I run a Dungeons and Dragons campaign > online, which requires similar skills. (Teaching maths is way easier > than getting my players to figure out some puzzles. Well, you’re very good at it! Like I said I like that you don’t just give me the answer you help me figure it out which is what I need. > 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? > > (We start in fifteen minutes. Want to come watch? Just telnet to > minstrelhall.com port 221!) Awesome, I may stop by and check it out. > > That's certainly effective. It's going to give you the right result. I > would be inclined to start from the small end and strip off the > seconds first, then the minutes, etc, because then you're working with > smaller divisors (60, 60, 24, 7 instead of 604800, 86400, 3600, 60); > most people will understand that a week is 7 days, but only people who > work with DNS will know that it's 604800 seconds. But both work. Yeah I had to look up how many seconds were in weeks and days. > > 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? > days = seconds / 86400 > seconds %= 86400 > hours = seconds / 3600 > seconds %= 3600 > minutes = seconds / 60 > seconds %= 60 > > > [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. : )
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Python 2.7.6 help with modules Scott W Dunning <swdunning@cox.net> - 2014-02-08 19:07 -0700
csiph-web