程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python xlrd package book Use of class book class in PY

編輯:Python

About Class Book(BaseObject):


This means that you should not instantiate this class yourself . You can call the function xlrd.open_workbook Return this object when

Self instantiation is like this :

book = Book()

However, this class should not instantiate itself , It's calling xlrd.open_workbook Will return this class

for instance :


The second code book = xlrd.open_workbook(bookname) It's called xlrd.open_workbook() This function , And then back to a Book object

Then we call xlrd package book.py Inside

Book Functions in class , You can use this second code book To invoke the .

That's it :

For example, we need to call Book This function in the class


You can use the statement

book.sheet_by_index( 0 ) To call

# here 0 It's a parameter , You can type in





  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved