Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12318
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder5.news.weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <me+list/python@ixokai.io> |
| 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; 'also:': 0.09; 'content- type:multipart/signed': 0.09; 'filename': 0.09; 'filename:fname piece:signature': 0.09; 'skip:[ 30': 0.09; 'subject:files': 0.09; 'am,': 0.12; 'subject:file': 0.13; 'def': 0.15; '(at)': 0.16; '(dot)': 0.16; 'content-type:application/pgp-signature': 0.16; 'filename:fname piece:asc': 0.16; 'filename:fname:signature.asc': 0.16; 'surprising': 0.16; 'wrote:': 0.16; 'blog:': 0.21; 'header :In-Reply-To:1': 0.22; 'van': 0.26; 'import': 0.28; 'print': 0.29; 'hansen': 0.30; 'received:24': 0.32; 'to:addr:python-list': 0.33; '...': 0.34; 'subject:text': 0.35; 'received:google.com': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'received:74.125': 0.39; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.71; 'mail:': 0.73; 'username': 0.77; 'url:io': 0.93 |
| Sender | Ixokai <ixokai@ixokai.io> |
| Date | Sat, 27 Aug 2011 16:31:15 -0700 |
| From | Stephen Hansen <me+list/python@ixokai.io> |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Arrange files according to a text file |
| References | <6j8i57t6cgqunn3c1ci4p7u9mnpnvsrl8s@4ax.com> <j3bbmv$luo$1@dough.gmane.org> |
| In-Reply-To | <j3bbmv$luo$1@dough.gmane.org> |
| X-Enigmail-Version | 1.1.1 |
| OpenPGP | id=555B1FE5; url=http://id.ixokai.io/pub.asc |
| Content-Type | multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig45B28C5F376FDF70CC5F69E6" |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| Reply-To | me+list/python@ixokai.io |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.493.1314487883.27778.python-list@python.org> (permalink) |
| Lines | 51 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1314487883 news.xs4all.nl 2462 [2001:888:2000:d::a6]:57855 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:12318 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
On 8/27/11 11:06 AM, Emile van Sebille wrote: > from difflib import SequenceMatcher as SM > > def ignore(x): > return x in ' ,.' > > for filename in filenames: > ratios = [SM(ignore,filename,username).ratio() for username in > usernames] > best = max(ratios) > owner = usernames[ratios.index(best)] > print filename,":",owner It amazes me that I can still find a surprising new tool in the stdlib after all these years. Neat. /pinboards -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Arrange files according to a text file Ric@rdo - 2011-08-27 13:03 -0400
Re: Arrange files according to a text file MRAB <python@mrabarnett.plus.com> - 2011-08-27 18:22 +0100
Re: Arrange files according to a text file Emile van Sebille <emile@fenx.com> - 2011-08-27 11:06 -0700
Re: Arrange files according to a text file Ric@rdo - 2011-08-27 16:15 -0400
Re: Arrange files according to a text file Emile van Sebille <emile@fenx.com> - 2011-08-27 14:08 -0700
Re: Arrange files according to a text file Ric@rdo - 2011-08-27 19:18 -0400
Re: Arrange files according to a text file MRAB <python@mrabarnett.plus.com> - 2011-08-28 00:48 +0100
Re: Arrange files according to a text file Ric@rdo - 2011-08-27 20:21 -0400
Re: Arrange files according to a text file Emile van Sebille <emile@fenx.com> - 2011-08-27 18:10 -0700
Re: Arrange files according to a text file Ric@rdo - 2011-08-28 01:24 -0400
Re: Arrange files according to a text file Stephen Hansen <me+list/python@ixokai.io> - 2011-08-27 16:31 -0700
csiph-web