1
this code below it takes dice from a spreadsheet and plays on a list then want the dice from this list plays on another spreadsheet.
Until the list get but when it comes to moving to another spreadsheet I do not know how to do.. someone could help me
#coding:latin-1
import xlrd
from openpyxl import workbook
from openpyxl import open
from openpyxl import load_workbook
book=load_workbook("zanlorenzi.xlsx")
from openpyxl import Workbook
arquivo = xlrd.open_workbook('exp.xlsx')
planilha = arquivo.sheet_by_index(0)
lista_valores = planilha.col_values(0)
#inicio do programa
def xlread(arq_xls):
# abre o arquivo para leitura
xls = xlrd.open_workbook(arq_xls)
# pega a primeira linha do arquivo
plan = xls.sheets()[0]
for i in range(0,plan.nrows):
yield plan.row_values(i)
zanlorezi=[]
for i in xlread("exp.xlsx"):
zanlorezi.append(i)
#for a in zanlorezi:
#print(zanlorezi)
for i in xlread("zanlorenzi.xlsx"):
book=
#print(i)
book.save("zanlorenzi.xlsx")
for a in zanlorezi:
print(a)
thanks just did not understand porrque "#<"
– estagio de programador
I can use inside the dictionary key on the Worksheet object to place a variable?
– estagio de programador
I indicated with an arrow arrow to the dictionary, the key and the attribute. Each key has a unique and individual name and the attribute can be repeated :)
– stack.cardoso