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


Groups > comp.lang.python > #56363

Re: Code golf challenge: XKCD 936 passwords

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
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; 'digest': 0.04; 'from:addr:yahoo.co.uk': 0.04; 'skip:p 60': 0.07; 'filename': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'random': 0.14; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'red,': 0.16; 'wrote:': 0.18; 'trying': 0.19; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'rid': 0.24; 'subject:Code': 0.24; 'url:moin': 0.24; "i've": 0.25; 'this:': 0.26; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'header :In-Reply-To:1': 0.27; 'chris': 0.29; '[1]': 0.29; '[2]': 0.30; 'characters': 0.30; 'code': 0.31; 'lines': 0.31; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'another': 0.32; 'url:python': 0.33; 'monday,': 0.33; "who's": 0.35; 'but': 0.35; 'passwords': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'should': 0.36; 'too': 0.37; 'implement': 0.38; 'to:addr:python-list': 0.38; 'generating': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:x 10': 0.40; 'read': 0.60; 'most': 0.60; "you've": 0.63; 'email addr:gmail.com': 0.63; 'total': 0.65; 'fun?': 0.68; 'emails,': 0.69; 'impressive,': 0.84; 'skip:p 80': 0.84; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Code golf challenge: XKCD 936 passwords
Date Tue, 08 Oct 2013 08:48:17 +0100
References <mailman.828.1381213051.18130.python-list@python.org> <68365e43-498f-4ad2-bac3-6a02938159c7@googlegroups.com> <d9df49e7-f3c9-4f10-9321-1417b8d2b725@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-78-147-188-13.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0
In-Reply-To <d9df49e7-f3c9-4f10-9321-1417b8d2b725@googlegroups.com>
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.837.1381218515.18130.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1381218515 news.xs4all.nl 15975 [2001:888:2000:d::a6]:51040
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:56363

Show key headers only | View raw


On 08/10/2013 07:48, sprucebondera@gmail.com wrote:
> On Monday, October 7, 2013 8:45:39 PM UTC-10, spruce...@gmail.com wrote:
>> On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
>>
>>> Who's up for some fun? Implement an XKCD-936-compliant password
>>> generator in Python 3, in less code than this:
>>> print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
>>
>>> Second challenge: Use it for generating all your passwords :)
>>
>>> [1] https://en.wikipedia.org/wiki/Code_golf
>>> [2] http://xkcd.com/936/
>>
>>> ChrisA
>>
>> Well, here's a start:
>>
>> import random as r
>> print(*r.sample(open("/usr/share/dict/words").readlines(),4))
>> Shaves off 6 characters.
>
> And if we were actually trying then that filename should just be "/w". Would get rid of another 19 chars.
>

Very impressive, you've saved a total of 25 characters on one line and 
added too many lines to count to your emails, which I've snipped. 
Please read and digest this 
https://wiki.python.org/moin/GoogleGroupsPython, thanks in anticipation.

-- 
Roses are red,
Violets are blue,
Most poems rhyme,
But this one doesn't.

Mark Lawrence

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


Thread

Code golf challenge: XKCD 936 passwords Chris Angelico <rosuav@gmail.com> - 2013-10-08 17:17 +1100
  Re: Code golf challenge: XKCD 936 passwords sprucebondera@gmail.com - 2013-10-07 23:45 -0700
    Re: Code golf challenge: XKCD 936 passwords sprucebondera@gmail.com - 2013-10-07 23:48 -0700
      Re: Code golf challenge: XKCD 936 passwords Chris Angelico <rosuav@gmail.com> - 2013-10-08 17:52 +1100
        Re: Code golf challenge: XKCD 936 passwords Roy Smith <roy@panix.com> - 2013-10-08 08:33 -0400
          Re: Code golf challenge: XKCD 936 passwords Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-08 15:36 +0000
            Re: Code golf challenge: XKCD 936 passwords Tim Chase <python.list@tim.thechases.com> - 2013-10-08 11:07 -0500
              Re: Code golf challenge: XKCD 936 passwords Tobiah <toby@tobiah.org> - 2013-10-08 10:38 -0700
      Re: Code golf challenge: XKCD 936 passwords Steve Simmons <square.steve@gmail.com> - 2013-10-08 08:02 +0100
      Re: Code golf challenge: XKCD 936 passwords Chris Angelico <rosuav@gmail.com> - 2013-10-08 18:13 +1100
      Re: Code golf challenge: XKCD 936 passwords Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-08 08:48 +0100
    Re: Code golf challenge: XKCD 936 passwords random832@fastmail.us - 2013-10-08 11:47 -0400
      Re: Code golf challenge: XKCD 936 passwords sprucebondera@gmail.com - 2013-10-08 13:27 -0700
        Re: Code golf challenge: XKCD 936 passwords Chris Angelico <rosuav@gmail.com> - 2013-10-09 07:35 +1100
    Re: Code golf challenge: XKCD 936 passwords Roy Smith <roy@panix.com> - 2013-10-08 21:38 -0400
      Re: Code golf challenge: XKCD 936 passwords Chris Angelico <rosuav@gmail.com> - 2013-10-09 13:10 +1100
        Re: Code golf challenge: XKCD 936 passwords Roy Smith <roy@panix.com> - 2013-10-08 22:52 -0400
      RE: Code golf challenge: XKCD 936 passwords Nick Cash <nick.cash@npcinternational.com> - 2013-10-09 16:07 +0000
        Re: Code golf challenge: XKCD 936 passwords Roy Smith <roy@panix.com> - 2013-10-09 20:29 -0400
  Re: Code golf challenge: XKCD 936 passwords Tobiah <toby@tobiah.org> - 2013-10-08 10:58 -0700

csiph-web