Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12818

strang thing:

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!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 <1248283536@qq.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.063
X-Spam-Evidence '*H*': 0.88; '*S*': 0.00; 'callable': 0.09; 'csv': 0.09; 'output': 0.10; 'row': 0.16; 'to:name:python-list': 0.18; 'skip:( 30': 0.24; 'code': 0.25; 'import': 0.28; 'print': 0.29; 'typeerror:': 0.30; "can't": 0.33; 'to:addr:python-list': 0.33; 'object': 0.35; 'file': 0.36; 'skip:o 20': 0.38; 'ok,': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; "it's": 0.40; 'subject:thing': 0.84; 'subject::': 0.87
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s0907; t=1315297124; bh=FLgyJlcthdzHtuPOECVKh7y1oZJmWhymiLlQPq8nIG8=; h=X-QQ-SSF:X-QQ-BUSINESS-ORIGIN:X-Originating-IP:X-QQ-STYLE: X-QQ-mid:From:To:Subject:Mime-Version:Content-Type: Content-Transfer-Encoding:Date:X-Priority:Message-ID:X-QQ-MIME: X-Mailer:X-QQ-Mailer; b=TjG3+KDCt/MpWezAgk+xaNNFk931IM0TjTRZHkMVjjn2m7EYkp6/fDHchx1QmjVsh w6/a6HVs/euc5CzmVQ1UFgXlFbFo2Fsz91HQ3A/h61hJqYfq9cYc7MS7s7YAPML
X-QQ-SSF 00000000000000F0000000000000000
X-QQ-BUSINESS-ORIGIN 2
X-Originating-IP 113.116.180.204
X-QQ-STYLE
X-QQ-mid webmail24t1315297121t474849
From "守株待兔" <1248283536@qq.com>
To "python-list" <python-list@python.org>
Subject strang thing:
Mime-Version 1.0
Content-Type multipart/alternative; boundary="----=_NextPart_4E65D761_0881CB40_699B4C49"
Content-Transfer-Encoding 8Bit
Date Tue, 6 Sep 2011 16:18:41 +0800
X-Priority 3
X-QQ-MIME TCMime 1.0 by Tencent
X-Mailer QQMail 2.x
X-QQ-Mailer QQMail 2.x
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
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.793.1315297135.27778.python-list@python.org> (permalink)
Lines 62
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1315297135 news.xs4all.nl 2448 [2001:888:2000:d::a6]:38276
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:12818

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

i found stange thing that i can't solve
import os
import  csv

for  name  in   os.listdir('/tmp/quote/'):
    filename='/tmp/quote/'+name
    file = open(filename,'r')
    file.readline()      
    for row in csv.reader(file):
                print   row[0], row[1], row[2], row[3],row[4], row[5], row[6]

it's ok,
when i  add    (date,open,high,low,close,vol,adjclose) = (row[0], row[1], row[2], row[3],row[4], row[5], row[6])
change the code into 
import os
import  csv

for  name  in   os.listdir('/tmp/quote/'):
    filename='/tmp/quote/'+name
    file = open(filename,'r')
    file.readline()      
    for row in csv.reader(file):
            (date,open,high,low,close,vol,adjclose) = (row[0], row[1], row[2], row[3],row[4], row[5], row[6])
            print   row[0], row[1], row[2], row[3],row[4], row[5], row[6]


the wrong  output is :
    file = open(filename,'r')
TypeError: 'str' object is not callable

i don't know why??

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

strang thing: "守株待兔" <1248283536@qq.com> - 2011-09-06 16:18 +0800
  Re: strang thing: Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-13 13:28 +1000
    Re: strang thing: Chris Angelico <rosuav@gmail.com> - 2011-09-13 13:42 +1000

csiph-web