xlrd基本操作
#coding=utf-8
import xlrd
def read_excel():
workbook = xlrd.open_workbook('people.xlsx')
sheet2 = workbook.sheet_by_index(0) # sheet索引从0开始
# rows = sheet2.row_values(2) # 获取第四行内容
cols = sheet2.col_values(0) # 获取第三列内容
# print rows
# print cols
#弹出第一个单元格无用信息
colslist = cols.pop(0)
for i in cols:
print i.encode('utf-8')
# 获取单元格内容
# print sheet2.cell(1, 0).value.encode('utf-8')
# print sheet2.cell_value(1, 0).encode('utf-8')
# print sheet2.row(1)[0].value.encode('utf-8')
if __name__ == '__main__':
read_excel()
xlrd基本操作的更多相关文章
- python 读 excel 模块: xlrd
主要来自:[ python中使用xlrd.xlwt操作excel表格详解 ] 为了方便阅读, 我将原文两个模块拆分为两篇博文: [ python 读 excel 模块: xlrd ] [ python ...
- Selenium2+python自动化之读取Excel数据(xlrd)
前言 当登录的账号有多个的时候,我们一般用excel存放测试数据,本节课介绍,python读取excel方法,并保存为字典格式. 一.环境准备 1.先安装xlrd模块,打开cmd,输入pip inst ...
- Selenium2+python自动化58-读取Excel数据(xlrd)
前言 当登录的账号有多个的时候,我们一般用excel存放测试数据,本节课介绍,python读取excel方法,并保存为字典格式. 一.环境准备 1.先安装xlrd模块,打开cmd,输入pip inst ...
- python操作excel之 模块 xlrd
xlrd是专门用来在python中读取微软execel的模块,可以自己直接下载安装,也可以通过包管理器安装. 官方资料: 下载地址:http://pypi.python.org/pypi/xlrd 官 ...
- Selenium2+python自动化58-读取Excel数据(xlrd)【转载】
前言 当登录的账号有多个的时候,我们一般用excel存放测试数据,本节课介绍,python读取excel方法,并保存为字典格式. 一.环境准备 1.先安装xlrd模块,打开cmd,输入pip inst ...
- Python如何连接Mysql及基本操作
什么要做python连接mysql,一般是解决什么问题的 做自动化测试时候,注册了一个新用户,产生了多余的数据,下次同一个账号就无法注册了,这种情况怎么办呢?自动化测试都有数据准备和数据清理的操作,如 ...
- Key/Value之王Memcached初探:二、Memcached在.Net中的基本操作
一.Memcached ClientLib For .Net 首先,不得不说,许多语言都实现了连接Memcached的客户端,其中以Perl.PHP为主. 仅仅memcached网站上列出的语言就有: ...
- Android Notification 详解(一)——基本操作
Android Notification 详解(一)--基本操作 版权声明:本文为博主原创文章,未经博主允许不得转载. 微博:厉圣杰 源码:AndroidDemo/Notification 文中如有纰 ...
- Android Notification 详解——基本操作
Android Notification 详解 版权声明:本文为博主原创文章,未经博主允许不得转载. 前几天项目中有用到 Android 通知相关的内容,索性把 Android Notificatio ...
随机推荐
- this、target、currentTarget
this:绑定事件所触发行为的对象 target:最开始冒泡的的对象 currentTarget:事件触发行为的对象 this == target currentTarget和this 是target ...
- session.setAttribute和session.getAttribute
网上搜了些资料 ----------------------------------------------------------------------------- B/S架构中,客户端与服务器 ...
- Java初学者笔记五:泛型处理
一.泛型类: 泛型是指适用于某一种数据类型而不是一个数据机构中能存不同类型 import java.io.*; import java.nio.file.Files; import java.nio. ...
- Android 让GridView的高度为Wrap_content根据内容自适应高度
From:http://www.jayway.com/2012/10/04/how-to-make-the-height-of-a-gridview-wrap-its-content/ 如果把Grid ...
- 160226、js常用的验证
/*** 特殊符号 */ function specialCharacter(carNo){ var st=/^[^/@#$%^&*()—''_()!¥~·..,-<><&g ...
- codeforces#505--C Plasticine Zebra
C. Plasticine zebra time limit per test 1 second memory limit per test 256 megabytes input standard ...
- java 中的控制台端口的输入
java 中基于控制台端的输入时最基本的操作. 第一步 导入Scanner类 import java.util.Scanner; 第二步 创建输入对象 input Scanner input=new ...
- 更快写入的落脚点不是线程数而是mysql连接数 对数据库 批处理 批写入
批提交mysql 单线程的批提交 nohup python fromRedisoToMysqlSingleThreadOneConnBatchInsert.py 100 10.24.192.192 ...
- Information:java: Errors occurred while compiling module 'spring'
IntellJ Idea遇到Errors occurred while compiling module的解决方法 - sully2008的专栏 - CSDN博客 https://blog.csdn. ...
- ES_DEVOPS-1
When dealing with a large number of parallel operations in elasticsearch, such as search requests or ...