我想用我找到的物品之后做一些东西。出于测试目的,我正在更改名称。但结果如下:
第一个(删除后)并未受到影响。有人能帮助我吗?
import csv
divisor = 500000
outfileno = 1
outfile = None
with open('testM.txt', 'r') as infile:
infile_iter = csv.reader(infile)
header = next(infile_iter)
for index, row in enumerate(infile_iter):
if index % divisor == 0:
if outfile is not None:
outfile.close()
outfilename = 'big-{}.csv'.format(outfileno)
outfile = open(outfilename, 'w')
outfileno += 1
writer = csv.writer(outfile)
writer.writerow(header)
writer.writerow(row)
if outfile is not None:
outfile.close()
答案 0 :(得分:-1)
pnConacts.Controls
- 非静态字段中的项目,并尝试在静态上下文中使用它; rUser.DisplayName = i.ToString();
仅在foreach上下文中更改名称 UPD:在你的情况下使用简单的循环for
是更好的方法,你需要在按钮名称中添加索引