今天在写登录程序练习的时候,黑名单文件中多了几行空行.导致运行的时候报错:IndexError: list index out of range 代码 brackData = open(brackDataPath,"r") for line in brackData: temp = line.strip().split(',') brackDict[temp[0]] = int(temp[1]) brackData.close() 错误 Traceback (most recent c
可以通过改变当前文件的偏移量来实现文件的读取 -offsetInFile获取文件当前的位移量 -seekToFileOffset:(NSUInteger)length设置文件当前的位移量 -readDataOfLength:(NSUInteger)length随机读取文件内容的字节数 -seekToEndOfFile将文件跳到结尾 // // main.m // 04-NSFileHandle随机读取 // // Created by ma c on 15/8/24. // Copyright
, "Test1.txt") ; if the file could be read, we continue... , "Test2.txt") ) = ; loop as long the 'end of file' isn't reached Astring$=ReadString() A$=StringField(Astring$,,",") B$=StringField(Astring$,,",") WriteStr