[Tutor] Squlite3 problem

2007-03-13 Thread Jim Roush
I'm geting the following error message and I'm stumped Traceback (most recent call last): File "C:\markets\source\QuantScan\QuantScan4_3.py", line 1362, in db.close() sqlite3.OperationalError: Unable to close due to unfinalised statements Here 's the relevant code db = sqlite.conn

Re: [Tutor] Sorting a list of lists aka nested lists

2005-08-13 Thread Jim Roush
Danny Yoo wrote: >On Sat, 13 Aug 2005, Jim Roush wrote: > > > >>I have a python script that creates a list of lists like so: >> >>Quant.append( [ db_ticker, stock_close, MTD, 0, QTD, 0, YTD, 0, 0, 0 ] ) >> >>After Quant is created, I want to sort

[Tutor] Sorting a list of lists aka nested lists

2005-08-13 Thread Jim Roush
I have a python script that creates a list of lists like so: Quant.append( [ db_ticker, stock_close, MTD, 0, QTD, 0, YTD, 0, 0, 0 ] ) After Quant is created, I want to sort it by MTD. If I use a simple Quant.sort(), I assume its going to sort by 'db_ticker' which is not what I want. I've

[Tutor] Can't figure out AttributeError message

2005-07-07 Thread Jim Roush
I'm getting the following error message: AttributeError: 'tuple' object has no attribute 'seek' below is the code that produced the error. The line in question is marked with arrow in the left margin. Any help would be appreciated. def build_sp500_rand(): sp500_csv = open('c:/indic