我有一个大约1000行25列宽的excel文件。在
我要做的是创建一个脚本,根据用户输入查看excel文件。(本例中为姓名)
我当前的代码如下:
import xlrd
file_location =r"C:\Users\extoskben\Desktop\Datorer.xlsx"
workbook = xlrd.open_workbook(file_location)
sheet = workbook.sheet_by_index(0)
User = input("What's the users name?: ")
我希望代码从excel文件中读取,并根据匹配的名称打印所有列的结果。在
编辑:
excel文件的结构:
^{pr2}$我想知道怎样才能只打印出第15行和第8行的结果,而不打印“X”。在
此代码执行您想要的操作:
编辑:
如果您想在第五个循环中打印第五个特定的行,则可以使用:
^{pr2}$相关问题 更多 >
编程相关推荐