Python's Excel operations

Source: Internet
Author: User
#coding: utf-8__author__ = ' similarface ' Import xlrdbook=xlrd.open_workbook ('/users/similarface/downloads/ 0808-10 x et/0808-10 et.xlsx ') #遍历所有的sheetsfor sheet in Book.sheets ():    print (sheet.name)    #print Sheetbook = Xlrd.open_workbook ('/users/similarface/downloads/0808-10 et/0808-10 x et.xlsx ') #获取指定的sheetsheet = Book.sheet_by_ Name (' Sheet1 ') #获取sheet的行数print sheet.nrows# traverse all line numbers for the sheet for I in range (sheet.nrows):    print i# traverse all rows of sheet for I in Range (sheet.nrows):    print sheet.row_values (i) #遍历所以的行, for I in Range (sheet.nrows):    row=sheet.row_values (i)    #遍历行的所有列的值 for    cell in row:        print cell

  

Python's Excel operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.