Advertisement
cd62131

binary i/o

May 27th, 2019
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. #!/usr/bin/python3
  2. import sys
  3. with open(sys.argv[1], 'rb') as f:
  4.     with open(sys.argv[2], 'wb') as w1:
  5.         with open(sys.argv[3], 'wb') as w2:
  6.             data = f.read(22)
  7.             while data:
  8.                 w1.write(data + b'\n')
  9.                 w2.write(data)
  10.                 data = f.read(22)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement