Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
xlrd 可以很容易地知道最后一列是什么。
有没有使用win32com 的简单方法?
我试过使用 ws.UsedRange.Rows.Count 但这似乎没有给出正确的答案。
这被定义为给出已用范围内的行数(可能不是从 cell 开始)。您需要工作表中的列数。A1
A1
尝试这样的事情:
used = ws.UsedRange nrows = used.Row + used.Rows.Count - 1 ncols = used.Column + used.Columns.Count - 1
我有两列,Entry和text_image,在一个表中。当循环查看数组中的所有行时,我可以获得结果,但我希望它添加/images到文本以img. 这是为了将具有“img”(表示行内的文本)的行定向到正确的文件夹。可能需要进一步解释来说明原因,但我不会深
Entry
text_image
/images
img