以下是我当前代码的一个片段:
with open((filepath), 'w') as t:
data = [(name), "scored", (str(score)) + "/10"]
preader = csv.reader(t, delimiter=' ', quotechar='|')
pwriter = csv.writer(t, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
pwriter.writerow(data)
t.close()
这表明位置(filepath)中的文件现在包含一个分数。 我想让程序复制的前3行(3个最新的分数)的所有csv文件在目录E:和把他们放在一个文件。你知道吗
我该怎么做呢?如能迅速答复,将不胜感激。你知道吗
在处理一小部分数据时,不需要
csv
模块。你知道吗相关问题 更多 >
编程相关推荐