GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AutomatePython/12-excel at master · xudaoping/AutomatePython

Expand file tree

/

12-excel

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

12-excel

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
blankRowInserter.py
blankRowInserter.py
 
 
census2010.py
census2010.py
 
 
censuspopdata.xlsx
censuspopdata.xlsx
 
 
example.xlsx
example.xlsx
 
 
example_copy.xlsx
example_copy.xlsx
 
 
excelToText.py
excelToText.py
 
 
formula.py
formula.py
 
 
multiplicationTable-10.xlsx
multiplicationTable-10.xlsx
 
 
multiplicationTable-20.xlsx
multiplicationTable-20.xlsx
 
 
multiplicationTable-20.xlsx.blank.xlsx
multiplicationTable-20.xlsx.blank.xlsx
 
 
multiplicationTable-20.xlsx.blank.xlsx.trans.xlsx
multiplicationTable-20.xlsx.blank.xlsx.trans.xlsx
 
 
multiplicationTable-6.xlsx
multiplicationTable-6.xlsx
 
 
multiplicationTable.py
multiplicationTable.py
 
 
produceSales.xlsx
produceSales.xlsx
 
 
readCensusExcel.py
readCensusExcel.py
 
 
readExcel.py
readExcel.py
 
 
sampleChart.xlsx
sampleChart.xlsx
 
 
styled.xlsx
styled.xlsx
 
 
stylingUnit.py
stylingUnit.py
 
 
textToExcel.py
textToExcel.py
 
 
trans.xlsx
trans.xlsx
 
 
trans.xlsx.trans.xlsx
trans.xlsx.trans.xlsx
 
 
transposition.py
transposition.py
 
 
updateProduce.py
updateProduce.py
 
 
updatedProduceSales.xlsx
updatedProduceSales.xlsx
 
 
writeExcel.py
writeExcel.py
 
 
writeFormula.xlsx
writeFormula.xlsx
 
 

README.md

Outline

openpyxl模块:处理Excel表格

pip install openpyxl

import openpyxl
wb = openpyxl.load_workbook('example.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')

从电子表格文件中读取单元格涉及的所有函数、方法和数据类型。

  1. 导入 openpyxl 模块。
  2. 调用 openpyxl.load_workbook()函数。
  3. 取得 Workbook 对象。
  4. 调用 get_active_sheet()或 get_sheet_by_name()工作簿方法。
  5. 取得 Worksheet 对象。
  6. 使用索引或工作表的 cell()方法,带上 row 和 column 关键字参数。
  7. 取得 Cell 对象。
  8. 读取 Cell 对象的 value 属性。
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.