Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.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.030 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'string.': 0.04; 'function,': 0.07; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'helps!': 0.16; 'open()': 0.16; 'received:209.85.210.174': 0.18; 'received:mail- iy0-f174.google.com': 0.18; 'trying': 0.21; 'header:In-Reply- To:1': 0.22; 'assigning': 0.23; 'loop,': 0.23; 'skip:( 30': 0.24; 'message-id:@mail.gmail.com': 0.29; 'second': 0.29; '\xc2\xa0\xc2\xa0\xc2\xa0': 0.30; 'usual': 0.31; 'error': 0.32; 'to:addr:python-list': 0.33; 'calling': 0.33; 'file': 0.36; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'your': 0.61; 'hope': 0.61; 'you.': 0.62; 'subject:thing': 0.84; 'subject::': 0.87 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=KdBRT2aD7g4CfaWP5Nk1U6oQvsEI+n05su8J0RJPOvI=; b=wi12zjKLXc0ZW1n06NIMx/4SBCZNIROJTU3rUW0PveWR2DgF/mR6BiFnAT2ZhSyZ5J +1RQpPTvqTdLBi0FdI5HhN9ES0w7DwakPrDoviw5krK9tjnFrNrZSU01SdEWMcfY5WPi Yms8X3zp/5ixqMX0olcnX4ukGdhDnzFHbjlKY= MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 6 Sep 2011 18:22:37 +1000 Subject: Re: strang thing: From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 1315297360 news.xs4all.nl 2444 [2001:888:2000:d::a6]:53059 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12820 2011/9/6 =E5=AE=88=E6=A0=AA=E5=BE=85=E5=85=94 <1248283536@qq.com>: > =C2=A0=C2=A0=C2=A0 file =3D open(filename,'r') > when i=C2=A0 add=C2=A0=C2=A0=C2=A0 (date,open,high,low,close,vol,adjclose= ) =3D (row[0], row[1], You're assigning to the name "open", which is shadowing the built-in of the same name. The second time through the loop, you're not calling the usual open() function, you're trying to call your string. That's what your error is telling you. Hope that helps! ChrisA