-
- try:
- file_inp = open(argv[1], "r")
- file_out = open(argv[2], "wb")
- line = file_inp.readline()
- while line:
- line = line.rstrip('\n')
- line = line.rstrip('\r')
+
+ with file(argv[1], "r") as file_inp, file(argv[2], "wb") as file_out:
+ for line in file_inp:
+ line = line.rstrip('\n').rstrip('\r')