[Tutor] Importingf a List from Module

Orri Ganel singingxduck at gmail.com
Sun Aug 28 20:21:42 CEST 2005


On 8/28/05, Tom Strickland <tlinux at comcast.net> wrote: 
> 
> Tom Strickland wrote:
> 
> >>Here are the modules in question:
> >>
> --<SNIP>--
> > ######This is the enterData.py module
> > ##!/usr/bin/python2.4
> > input = open('/home/tom/Python/Input/SPY2.csv', 'r')
> > s = input
> > date =[]
> > open = []
> > close = []
> > hi = []
> > lo = []
> > vol = []
> > for s in input:
> > s = s[:-2]
> > y =[]
> > y = s.split(',')
> > date.append(y[0])
> > open.append(float(y[1]))
> > hi.append(float(y[2]))
> > lo.append(float(y[3]))
> > close.append(float(y[4]))
> > vol.append(float(y[5]))
> > input.close()
> > for i in range(5):
> > print close[i]
> > print 'enterData.py'

 I don't know if this would affect anything, but one of your lists is named 
"open" which isn't a good idea because that overrides the builtin "open()" 
(the one you use to open a new file).




-- 
Email: singingxduck AT gmail DOT com
AIM: singingxduck
Programming Python for the fun of it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050828/13b683d2/attachment.htm


More information about the Tutor mailing list