Python - a script to improve the size of a text file
Hi there I'm fairly new to Python. I have at work a script (written by my predecessor) to reduce the size of an input text file. From what I can see after going through 4 moduels of learning here today, all it seems to be doing is to append existing content onto a new file. Does this actually help improve the size of the file or is it also doing something else (please see script below). #!usr/bin/env from sys import argv data_file = raw_input("Data_File: ") output_file = raw_input("Output_File: ") data = open(data_file,"r") line = data.readline() new_file = open(output_file,"a") while line: values = line.split(",") new_line = [] for value in values: entry = value.strip() new_line.append(entry) inew_line = ",".join(new_line) new_file.write(inew_line + "\n") line = data.readline() new_file.close() Also, it may be a silly question but what does the module "from sys import argv" do? Thanks!!