Open a Workbook with XLWINGS without making it visible

后端 未结 3 1711
独厮守ぢ
独厮守ぢ 2021-02-01 19:01

I am starting to use XLWings (not that I like Excel, at all, but it is something I HAVE TO do). The thing is that I cannot find the way to make Python open a Workbook without sh

3条回答
  •  -上瘾入骨i
    2021-02-01 19:34

    You could try 'with open', for example

    with open ("write.csv", "a", newline='') as file:  
        fields=['score', 'name']                       
        writer=csv.DictWriter(file, fieldnames=fields)
        writer.writerow({'score' : score, 'name' : username})
    
    with open ("write.csv", "r") as file:
        sortlist=[]
        reader=csv.reader(file)
        for i in reader:
            sortlist.append(i)
    

提交回复
热议问题