我正在使用文件处理的append方法在文件中写入数据,但它没有显示在文件中。 读取文件时也会显示空字节错误
with open("filename.txt",'a') as f_ro_panel:
f_ro_panel.write('\n'+str(vl)+'\t'+str(op_minute)+'\t'+str(bcc)+\
'\t'+str(temp)+'\t'+str(tds2)+'\t'+str(tds1)+'\t'+str(pfr)+\
'\t'+str(rfr)+'\t'+str(rwpc)+'\t'+str(hppc)+'\t'+str(twv)+\
'\t'+str(rwv)+'\t'+str(uvst)+'\t'+str(tsc)+'\t'+str(tlv))
f_ro_panel.close()
这是写作的准则
在阅读时,我正在使用这个程序
with open("filename.txt", 'rU') as my_file:
reader = csv.reader(my_file, delimiter='\t')
my_list = list(reader)
ListLen = len(my_list)
my_file.close()
任何帮助都将不胜感激
您可以检查以下几项:
我试着运行你的代码,它对我来说很好
相关问题 更多 >
编程相关推荐