【发布时间】:2016-11-18 11:41:08
【问题描述】:
我最近在这里问了一个问题how can I read each line of a xls file with pausing,我得到的答案解决了我的问题。代码如下
import time
import pandas as pd
import os
import xlrd
# at first I try to know how many rows and how many columns I have
workbook = xlrd.open_workbook('myfile.xls')
for sheet in workbook.sheets():
for row in range(sheet.nrows):
for column in range(sheet.ncols):
os.system('clear')
print "value::: ", sheet.cell(row,column).value
time.sleep(5.5) # pause 5.5 seconds
我想要做的是以某种方式制作循环,使其到达 xls 行的末尾,然后一遍又一遍地返回开头,直到我停止它或有时暂停它,你知道怎么做吗?去做这个 ?
【问题讨论】:
-
查看修改后的答案。
标签: python