Python openpyxl不写入单元格

时间:2018-07-15 06:35:18

标签: python python-3.x openpyxl

我正在尝试从excel说A1 == 4读取一个值,并使用这些

wb = load_workbook("GameExcel.xlsx")
names = wb.sheetnames
sheet = wb['GameEnviroment']
sheet['C4'].value 

并且它可以很好地读取当前单元格的信息,但是它不想写入该单元格。没有错误,就是行不通。这是写代码

C3Val = sheet['C4'].value
sheet.cell(row=3, column=4).value = (C3Val + ' 3')

1 个答案:

答案 0 :(得分:2)

正如PRMoureu在上面的评论中所述,对文件进行更改后,我需要运行let sb = UISearchBar() sb.searchBarStyle = UISearchBarStyle.minimal sb.showsSearchResultsButton = true // sb.setClearButtonColorTo(color: UIColor.white) let textFieldInsideSearchBar = sb.value(forKey: "searchField") as? UITextField let crossIconView = textFieldInsideSearchBar?.value(forKey: "clearButton") as? UIButton crossIconView?.setImage(crossIconView?.currentImage?.withRenderingMode(.alwaysTemplate), for: .normal) crossIconView?.tintColor = .white