代码:
fileReadObj = open("input.txt") fileWriteObj = open("output.txt", 'w') fileLineText = fileReadObj.readline() while ('' != fileLineText): string = fileLineText fileWriteObj.write(string) fileLineText = fileReadObj.readline() fileReadObj.close() fileWriteObj.close()