Error Type: IndexError Error Value: list index out of range I am importing a text file via an external method. I did my testing with a file that contained 18 records. All went fine. Stepped up the testing to a file with 550 records. The real thing will have over 30,000. Now it doesn't work. :-) It's not a memory issue or anything that you would expect with an increase i records. Anyway, here's the link to where I can the results. I also added a method to display the dictionary contents (raw mode) for testing. I don't see anything wrong with it. I have a ZClass that I will be creating instances of, when I get the code right. :-) http://www.freepm.org:8080/tkfpm/Drugs/multum_update Here's the HTML method: ------------------------------------------------------ <dtml-var standard_html_header> <table border="3" cellspacing="5" cellpadding="5"> ...(table headers removed for bandwith's sake) <dtml-let drugs="importmultum()"> <dtml-in "drugs.keys()"> <dtml-if sequence-even> <tr bgcolor="#77ccbb"> <dtml-else> <tr bgcolor="#cc6600"> </dtml-if> <dtml-let dictkey=sequence-item> <td><dtml-var sequence-number></td> <td><dtml-var dictkey></td> <td><dtml-var "drugs[dictkey][0]"></td> <td><dtml-var "drugs[dictkey][1]"></td> <td><dtml-var "drugs[dictkey][2]"></td> <td><dtml-var "drugs[dictkey][3]"></td> <td><dtml-var "drugs[dictkey][4]"></td> <td><dtml-var "drugs[dictkey][5]"></td> <td><dtml-var "drugs[dictkey][6]"></td> <td><dtml-var "drugs[dictkey][7]"></td> <td><dtml-var "drugs[dictkey][8]"></td> <td><dtml-var "drugs[dictkey][9]"></td> <td><dtml-var "drugs[dictkey][10]"></td> <td><dtml-var "drugs[dictkey][11]"></td> <td><dtml-var "drugs[dictkey][12]"></td> <td><dtml-var "drugs[dictkey][13]"></td> <td><dtml-var "drugs[dictkey][14]"></td> <td><dtml-var "drugs[dictkey][15]"></td> <td><dtml-var "drugs[dictkey][16]"></td> <td><dtml-var "drugs[dictkey][17]"></td> <td><dtml-var "drugs[dictkey][18]"></td> <td><dtml-var "drugs[dictkey][19]"></td> <td><dtml-var "drugs[dictkey][20]"></td> <td><dtml-var "drugs[dictkey][21]"></td> <td><dtml-var "drugs[dictkey][22]"></td> <td><dtml-var "drugs[dictkey][23]"></td> <td><dtml-var "drugs[dictkey][24]"></td> <td><dtml-var "drugs[dictkey][25]"></td> <td><dtml-var "drugs[dictkey][26]"></td> <td><dtml-var "drugs[dictkey][27]"></td> <td><dtml-var "drugs[dictkey][28]"></td> <td><dtml-var "drugs[dictkey][29]"></td> <td><dtml-var "drugs[dictkey][30]"></td> <td><dtml-var "drugs[dictkey][31]"></td> <td><dtml-var "drugs[dictkey][32]"></td> <td><dtml-var "drugs[dictkey][33]"></td> <td><dtml-var "drugs[dictkey][34]"></td> <td><dtml-var "drugs[dictkey][35]"></td> </dtml-let> </tr> </dtml-in> </dtml-let> </table> <dtml-var standard_html_footer> ------------------------------------------------------------------------- The RAW dictionary dump method: <dtml-var standard_html_header> <pre> <dtml-let drugs="importmultum()"> <b>Number of items:</b> <dtml-var "_.len(drugs.keys())"><br> <p> <dtml-in "drugs.keys()"> <dtml-let dictkey=sequence-item> <dtml-var sequence-number> <dtml-var sequence-item> <b>Length:</b> <dtml-var "_.len(drugs[dictkey])"> <dtml-var "drugs[dictkey]"><br> </dtml-let> </dtml-in> </dtml-let> </pre> <dtml-var standard_html_footer> ------------------------------------------------------------------------- I found that if I just include the first element of the list (<td><dtml-var "drugs[dictkey][0]"></td>) the HTML table renders. When I add the second list element is when it dies. I have looked at the source file to see if there are any incorrect (non-printables etc) didn't find any. THanks for any help/suggestions, -- Tim Cook, President -- Free Practice Management,Inc. | http://www.FreePM.com Office: (901) 884-4126 "Nearly everyone will lie to you given the right circumstances." - Bill Clinton
Tim Cook wrote:
Error Type: IndexError Error Value: list index out of range
OOPS! forgot the control panel info: Zope version: Zope 2.2.5b1 (binary release, python 1.5.2, linux2-x86) Python version: 1.5.2 (#10, Dec 6 1999, 12:16:27) [GCC 2.7.2.3] System Platform: linux2 Process ID: 32347 (3076) Running for: 24 days 9 hours 37 min 39 sec -- Tim Cook, President -- Free Practice Management,Inc. | http://www.FreePM.com Office: (901) 884-4126 "Nearly everyone will lie to you given the right circumstances." - Bill Clinton
Tim Cook wrote:
Tim Cook wrote:
Error Type: IndexError Error Value: list index out of range
Well, DUH me. I forgot the last two lines of the text file (it's a dump from a database sent to me from someone else). One only had the number of rows and the other an EOF. Sorry to waste your bandwidth. My external method now checks the length of the list before putting it intothe dictionary. :-) -- Tim Cook, President -- Free Practice Management,Inc. | http://www.FreePM.com Office: (901) 884-4126 "Nearly everyone will lie to you given the right circumstances." - Bill Clinton
participants (1)
-
Tim Cook