Last active
April 21, 2017 23:12
-
-
Save yarkovaleksei/86c4ce37e6c054264009f824e566df6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
names_file = 'names.txt' | |
father_names_file = 'father_names.txt' | |
combinations_file = 'combinations.txt' | |
def main(): | |
with open(combinations_file, 'w') as combinations: | |
with open(names_file, 'r') as names, open(father_names_file, 'r') as father_names: | |
names_lines = names.readlines() | |
father_names_lines = father_names.readlines() | |
for name in names_lines: | |
for father_name in father_names_lines: | |
line = "%s %s" % (name.replace("\n", ""), | |
father_name.replace("\n", "")) | |
combinations.write("%s\n" % line) | |
if __name__ == '__main__': | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Иванович | |
Степанович |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Иван | |
Степан |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment