1、读写excel:
import xlrd def readdata(): data=xlrd.open_workbook("E:\tinycase.xlsx") table=data.sheet_by_name("现价") buy=table.cell(i,7).value sell=table.cell(i,8).value
2、读写文件:
finame2='TestEventCase.evt' with open(finame2,'w') as fp2: fp2.write(TestEventsCase_str1)