Skip to content

Instantly share code, notes, and snippets.

@AlexBaranowski
Created December 30, 2017 23:14
Show Gist options
  • Save AlexBaranowski/cd7188479c5a4fe3bceed893e7063355 to your computer and use it in GitHub Desktop.
Save AlexBaranowski/cd7188479c5a4fe3bceed893e7063355 to your computer and use it in GitHub Desktop.
Very simple merging two files with same line - idea is to make tuple that will be hardcoded.
with open('some_args') as f1:
with open('some_names') as f2:
with open('out', 'w') as f3:
args = f1.readlines()
name = f2.readlines()
print('lenghts :', len(args), len(name))
for i in range(len(args)):
f3.write('(\'{}\', \'{}\'),\n'.format(args[i].strip(), name[i].strip()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment