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


Groups > comp.lang.python > #12820

Re: strang thing:

References <tencent_05A7597541D14E995173354F@qq.com>
Date 2011-09-06 18:22 +1000
Subject Re: strang thing:
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.794.1315297360.27778.python-list@python.org> (permalink)

Show all headers | View raw


2011/9/6 守株待兔 <1248283536@qq.com>:
>     file = open(filename,'r')

> when i  add    (date,open,high,low,close,vol,adjclose) = (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

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


Thread

Re: strang thing: Chris Angelico <rosuav@gmail.com> - 2011-09-06 18:22 +1000
  Re: strange thing: "W. eWatson" <wolftracks@invalid.com> - 2011-09-06 19:43 -0700
    Re: strange thing: Chris Angelico <rosuav@gmail.com> - 2011-09-07 12:48 +1000
      Re: strange thing: "W. eWatson" <wolftracks@invalid.com> - 2011-09-06 22:08 -0700

csiph-web