Skip to content

Instantly share code, notes, and snippets.

@martin-ueding
Last active August 29, 2015 14:20
Show Gist options
  • Save martin-ueding/732de53d573d790f2b32 to your computer and use it in GitHub Desktop.
Save martin-ueding/732de53d573d790f2b32 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright © 2015 Martin Ueding <dev@martin-ueding.de>
# Licensed under The MIT License
import argparse
def main():
options = _parse_args()
with open(options.first) as f:
lines1 = [s.strip() for s in f.readlines()]
with open(options.second) as f:
lines2 = f.readlines()
for first, second in zip(lines1, lines2):
with open(first + '.txt', 'w') as f:
f.write(second)
def _parse_args():
'''
Parses the command line arguments.
:return: Namespace with arguments.
:rtype: Namespace
'''
parser = argparse.ArgumentParser(description='')
parser.add_argument('first')
parser.add_argument('second')
options = parser.parse_args()
return options
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment