From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77206 Path: news.gmane.org!not-for-mail From: Pontus Lurcock Newsgroups: gmane.comp.tex.context Subject: Re: Check brackets and parentheses Date: Fri, 6 Jul 2012 15:24:01 +0100 Message-ID: <20120706142401.GO9970@rae.vm.bytemark.co.uk> References: <64C3576E-DF3A-470B-82C9-295690C44AB8@gmail.com> <20120706073844.GN9970@rae.vm.bytemark.co.uk> <4FF6DC1D.40307@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341584656 29236 80.91.229.3 (6 Jul 2012 14:24:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Jul 2012 14:24:16 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Jul 06 16:24:16 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sn9S4-0003H5-I2 for gctc-ntg-context-518@m.gmane.org; Fri, 06 Jul 2012 16:24:08 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E31021018E; Fri, 6 Jul 2012 16:24:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JhFrKFMn-jYS; Fri, 6 Jul 2012 16:24:05 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5ECE0101FA; Fri, 6 Jul 2012 16:24:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B00FC101FA for ; Fri, 6 Jul 2012 16:24:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qYI+IKChCE1S for ; Fri, 6 Jul 2012 16:24:03 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id E88EC1018E for ; Fri, 6 Jul 2012 16:24:03 +0200 (CEST) Original-Received: from rae.talvi.net (mail.dominoid.net [IPv6:2001:41c8:1:5986::10]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q66EO24e024779 for ; Fri, 6 Jul 2012 16:24:02 +0200 Original-Received: from pont by rae.talvi.net with local (Exim 4.72) (envelope-from ) id 1Sn9Rx-00025p-VO for ntg-context@ntg.nl; Fri, 06 Jul 2012 15:24:01 +0100 Content-Disposition: inline In-Reply-To: <4FF6DC1D.40307@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Bayes-Prob: 0.0037 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2001:41c8:1:5986::10; country=GB X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RHv2o2Lz - 191c90e2a70b - 20120706 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.13 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:77206 Archived-At: On Fri 06 Jul 2012, Hongwen Qiu wrote: > >def count(filename, opening, closing): > > print opening, closing > > f = open(sys.argv[1], 'r') > Shouldn't this line be > f = open(filename, 'r') > otherwise the 'filename' parameter will not be used Oops, you're quite correct. Of course it makes no difference at present, but one day some unlucky person will try to use the function elsewhere. The script was written in a hurry, as you may guess. Pont ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________