Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python': 0.09; '22,': 0.09; 'subject:method': 0.09; 'terminates': 0.09; 'that).': 0.09; 'wrong,': 0.09; 'itself.': 0.11; "wouldn't": 0.11; '(but': 0.15; '"file': 0.16; 'failed.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.17; 'fix': 0.17; 'found,': 0.17; 'module,': 0.17; 'subject:page': 0.17; 'jan': 0.18; 'saying': 0.18; 'windows': 0.19; 'app': 0.19; 'written': 0.20; 'trying': 0.21; 'error.': 0.21; 'tells': 0.22; 'tonight': 0.22; "i've": 0.23; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'looks': 0.26; 'guess': 0.27; 'dll': 0.27; 'message- id:@mail.gmail.com': 0.27; 'went': 0.28; 'all.': 0.28; 'crash': 0.29; 'hash': 0.29; 'convert': 0.29; 'probably': 0.29; 'basic': 0.30; 'helpful': 0.30; 'file': 0.32; 'legacy': 0.33; 'subject: .': 0.33; 'to:addr:python-list': 0.33; 'languages': 0.33; 'produced': 0.33; 'received:google.com': 0.34; 'open': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'really': 0.36; 'but': 0.36; 'visual': 0.36; 'uses': 0.37; 'why': 0.37; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'page': 0.38; 'to:addr:python.org': 0.39; 'little': 0.39; 'application': 0.40; 'where': 0.40; 'easy': 0.60; 'identify': 0.61; 'first': 0.61; 'back': 0.62; 'fire': 0.62; 'different': 0.63; 'pin': 0.65; '2013': 0.84; 'foremost,': 0.84; 'subject:Using': 0.84; '"it': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=+XVWnNLyYxLjRgjQV4bReECQVZJ9qSamqkkwkJ2vGzA=; b=qSNu1CLutmygl7gNo6bsj9XR8tGV4RmdmZPmL3CxTe74jlwP4wjPQzOQE3KkQQ41XD O9AJ7krZ8tq7Vp2KbmELoQUl044pAerPPx4znZUlkIKGbKQf+/UP2jqcGA/HnxqN8gX5 6M1DpFqueVfA+tpLG8J8xeV8hHQhRETbV26Oa/8kqvTrzadrdN13hN1tHULpCWYY0ZfH tYAJ9WEKDv1+TaoJ5/I4eT3VkeKENgSENvOPiduZjtqU6SX4/06IhNqlMkKCIy7pWMA7 yHiHQbCK3+sTVTCgPCBWT4Wju2QpqDORNFiRcZzbA2bcV7XViOU/9IJusIiRi3wLtiZ/ D5VA== MIME-Version: 1.0 X-Received: by 10.220.150.136 with SMTP id y8mr22909371vcv.34.1358857596413; Tue, 22 Jan 2013 04:26:36 -0800 (PST) In-Reply-To: References: <50fe787e$0$30003$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 22 Jan 2013 23:26:36 +1100 Subject: Re: Using filepath method to identify an .html page From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358857599 news.xs4all.nl 6877 [2001:888:2000:d::a6]:34450 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37264 On Tue, Jan 22, 2013 at 10:53 PM, Ferrous Cranus wrote: > # ================================================== > # produce a hash based on html page's filepath and convert it to an integet, that will be uses to identify the page itself. > # ================================================== > > pin = int( hashlib.md5( htmlpage ) ) > > > I just tried that but it produced an error. > What am i doing wrong? First and foremost, here's what you're doing wrong: You're saying "it produced an error". Python is one of those extremely helpful languages that tells you, to the best of its ability, exactly WHAT went wrong, WHERE it went wrong, and - often - WHY it failed. For comparison, I've just tonight been trying to fix up a legacy accounting app that was written in Visual BASIC back when that wouldn't get scorn heaped on you from the whole world. When we fire up one particular module, it bombs with a little message box saying "File not found". That's all. Just one little message, and the application terminates (uncleanly, at that). What file? How was it trying to open it? I do know that it isn't one of its BTrieve data files, because when one of THEM isn't found, the crash looks different (but it's still a crash). My current guess is that it's probably a Windows DLL file or something, but it's really not easy to tell... ChrisA