擅长:python、mysql、java
<p>在第一种情况下(正确的)</p>
<pre><code>sheet = wb.active
</code></pre>
<p>所以<code>sheet</code>是一个<em>字典。</em></p>
<p>在第二种(不正确的)情况下</p>
<pre><code>sheet = a # for a in sheetz, where sheetz = wb.sheetnames
</code></pre>
<p><code>sheet</code>是一个<strong>列表(因此它需要<em>整数</em>索引)。你知道吗</p>