Re: [Tutor] Importing a List from Module

2005-08-29 Thread Tom Strickland
The problem has been solved. It turned out that I made a newbie mistake that had nothing to do with importing lists. I have a function, sma, which calculates the moving average for a list of prices. I passed the "close" (subsequently changed to "cloze") list to the function as an argument. Ther

Re: [Tutor] Importing a List from Module

2005-08-28 Thread Tom Strickland
Tom Strickland wrote: > Eric, > > No, "xy" isn't used anywhere else in the program. It's just a dummy > variable I used to print out "enterData.close". I could easily have > left it out. > > Tom > > > Eric Walker wrote: > >>I am a newbie but do you have anything else named xy >>in your main modu

Re: [Tutor] Importing a List from Module

2005-08-28 Thread Tom Strickland
Byron, I'm confused (as usual). In "def returnList():" that you write below, should the items in the newList list be close[i] and looped to fill "newList" with the contents of "close"? If so, how is "returnLost" different from "close"? Thanks! Tom Byron wrote: > Tom Strickland wrote: > >>

Re: [Tutor] Importing a List from Module

2005-08-27 Thread Byron
Tom Strickland wrote: > In my "main" module I import "enterData" and try to read the first > element of "close" as follows: > > import enterData > xy=enterData.close > print xy[0] > > > When I do this it prints out the entire "close" list, not just the first > term. Hi Tom, I

Re: [Tutor] Importing a List from Module

2005-08-27 Thread Kent Johnson
Tom Strickland wrote: > I have a module called "enterData" which generates a list, "close" from > a data file. "close" is a list of floats. When I put a print statement > in that module it will print out an individual member of the list. For > example, > > print close[0] > > > prints the

[Tutor] Importing a List from Module

2005-08-27 Thread Tom Strickland
I have a module called "enterData" which generates a list, "close" from a data file. "close" is a list of floats. When I put a print statement in that module it will print out an individual member of the list. For example, print close[0] prints the first member of the list. In my "main"