Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.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.037 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'perl,': 0.07; 'skip:/ 10': 0.07; 'python': 0.09; 'hashlib': 0.09; 'subject:method': 0.09; 'language': 0.14; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'wrote:': 0.17; 'subject:page': 0.17; 'comfortable': 0.20; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'then.': 0.27; 'perl': 0.29; 'maybe': 0.29; 'code': 0.31; 'docs': 0.33; 'subject: .': 0.33; 'to:addr :python-list': 0.33; 'received:org': 0.36; 'message- id:@gmail.com': 0.36; 'should': 0.36; 'rather': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'kind': 0.61; '10000': 0.65; 'generated.': 0.65; 'guaranteed': 0.76; 'subject:Using': 0.84; 'fight': 0.97 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Tue, 22 Jan 2013 11:49:47 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121115 Thunderbird/10.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Using filepath method to identify an .html page References: <50fe787e$0$30003$c3e8da3$5496439d@news.astraweb.com> <50fe8e69$0$30003$c3e8da3$5496439d@news.astraweb.com> <0459659d-4ec2-4c7d-bee3-b4e363c916dd@googlegroups.com> <12a22c5b-88a9-4577-a642-abe1e56cce5e@googlegroups.com> <8ad4a124-37a8-41fc-938d-9535b8affcbf@googlegroups.com> In-Reply-To: <8ad4a124-37a8-41fc-938d-9535b8affcbf@googlegroups.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358880594 news.xs4all.nl 6867 [2001:888:2000:d::a6]:59495 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37333 On 01/22/2013 11:26 AM, Ferrous Cranus wrote: > which yields: > $ perl testMD5.pl > /index.html: 1066 > /about/time.html: 1547 Well do it the same with in python then. Just read the docs on the hashlib so you know what kind of object it returns and how to call methods on that object to return a big number that you can then do % 10000 on it. Note that your perl code is guaranteed to have collisions in the final number generated. If you're comfortable with perl, maybe you should use it rather than fight a language that you are not comfortable with and not understanding.