- try:
- file_inp = open(argv[1], "rb")
- file_out = open(argv[2], "w")
-
- while 1:
- # TODO: need to use defines instead of hardcoded 16, 64, etc.
- byte_s = file_inp.read(16)
+ with file(argv[1], "rb") as file_inp, file(argv[2], "w") as file_out:
+ while True:
+ byte_s = file_inp.read(READ_BLOCKSIZE)