我需要一些帮助输出一个我刚刚分配了变量的文件来完成我的代码。如果get_bool_input()输出文件,我需要一些帮助修复下面的位。
filename = class_name + ".csv"
csv.register_dialect('pipes', delimiter='|')
with open('filename.csv', 'a',newline='') as fp:
a = csv.writer(fp, delimiter=',')
data=[['Name','Score'],
[name,score]]
a.writerows()
if get_bool_input("Do you wish to view previous results for your class"):
print filename
else:
input ("Press any key to exit")