Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

print all data in excel openpyxl

import openpyxl

# 使用 load_workbook 讀取 test.xlsx
workbook = openpyxl.load_workbook('test.xlsx')

# 取得第一個工作表
sheet = workbook.worksheets[0]

# 顯示 row總數 及 column總數
print('row總數:', sheet.max_row)
print('column總數:', sheet.max_column)

# 顯示 cell 資料
for i in range(1, sheet.max_row+1):
    for j in range(1, sheet.max_column+1):
        print(sheet.cell(row = i, column = j).value)
Comment

PREVIOUS NEXT
Code Example
Python :: print is not working in python 
Python :: flask run function every minute 
Python :: dataframe conditional formatting max values 
Python :: concatenate the next row to the previous row pandas 
Python :: python [a]*b means [a,a,...b times] 
Python :: auto clipping path when upload image using python 
Python :: converting 1d array into upper triangular 
Python :: sss 
Python :: python 2.0 
Python :: Summarize text using LED huggingface 
Python :: python scale function 
Python :: how to convert array of arrays into single array with unique values in numpy 
Python :: how to discover which index labels are in other 
Python :: cvhaardetectobjects 
Python :: sumif in python on a column and create new column 
Python :: how to get a mouse press not hold in pygame 
Python :: combining sparse class 
Python :: django filter word count greater than 
Python :: python read stdin to string 
Python :: python clean all .pyc 
Python :: python fibonacci numbers 
Python :: convert python code to java using jython 
Python :: np.ma.filled 
Python :: polycarp and coins codeforces solution 
Python :: cross-validation sklearn image classification 
Python :: mechanize python #9 
Python :: take substring of every element in dataframe 
Python :: Custom Choropleth Labels in Geopandas 
Python :: filter all columns in pandas 
Python :: get dataframe deminsions 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =