wxgrid追加问题 [英] wxgrid append question

查看:52
本文介绍了wxgrid追加问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎在我的网格上创建了​​一条不存在的额外行,并且不会保存回文件。


我得到的错误是


self.rows [row] [col] = self.GetCellValue(row -1,col)

IndexError:列表索引超出范围


这是生成错误的代码部分

I seem to be creating an extra line on my grid that doesn''t exist and doesn''t save back to the file.

The error I get is

self.rows[row][col] = self.GetCellValue(row -1, col)
IndexError: list index out of range

This is the part of the code that generates the error

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号

推荐答案

你必须保持一切排好。所以


self.rows [row] [col] = self.GetCellValue(row -1,col)

IndexError:list index out范围


从GetCellValue()行中减去1可能会为self.rows索引抛出一些东西。
You''ve got to keep everything lined up. so


self.rows[row][col] = self.GetCellValue(row -1, col)
IndexError: list index out of range

subtracting 1 from row in GetCellValue() probably throws things off for self.rows indexing.


它给了我那个错误befour我通过尝试从网格中获取前一项来更改它。我甚至尝试了wxwiki中的一些东西并且无法让它工作......我认为它的另一面导致我的麻烦(但我可能是错的)self.rows [row] [col] I我可以从它的两边减1,看看我是否仍然得到错误。
It was giving me that error befour I changed it by trying to take the previous item from the grid. I even tried some of the stuff from the wxwiki and couldn''t get it to work.. I think it is the other side of it causing me trouble (but I could be wrong) self.rows[row][col] I supose I could subtract 1 from both sides of it to see if I still get the error.



我似乎在创建一个额外的行在我的网格上不存在,并且不会保存回文件。


我得到的错误是


self.rows [row] [col] = self.GetCellValue(row -1,col)

IndexError:列表索引超出范围


这是生成错误的代码部分

I seem to be creating an extra line on my grid that doesn''t exist and doesn''t save back to the file.

The error I get is

self.rows[row][col] = self.GetCellValue(row -1, col)
IndexError: list index out of range

This is the part of the code that generates the error

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


这篇关于wxgrid追加问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆