擅长:python、mysql、java
<p>我知道这是个老问题,但你也可以使用<a href="https://openpyxl.readthedocs.io/en/stable/tutorial.html" rel="nofollow noreferrer">^{<cd1>}</a></p>
<pre><code>from openpyxl import load_workbook
wb = load_workbook("BookName.xlsx") # Work Book
ws = wb.get_sheet_by_name('SheetName') # Work Sheet
column = ws['A'] # Column
column_list = [column[x].value for x in range(len(column))]
</code></pre>
<p>注:</p>
<ul>
<li><p><a href="https://pandas.pydata.org/" rel="nofollow noreferrer">Pandas</a>是一个很棒的库,但是安装它只是为了将excel列读入列表是一个过分的IMHO。</p></li>
<li><p><a href="https://github.com/python-excel/xlrd" rel="nofollow noreferrer"><em>xlrd</em></a>不再被维护。从<a href="https://github.com/python-excel/xlrd" rel="nofollow noreferrer">xlrd github page</a></p>
<blockquote>
<p>PLEASE NOTE: This library currently has no active maintainers. You are advised to use OpenPyXL instead. </p>
</blockquote></li>
</ul>