Skip to content

Instantly share code, notes, and snippets.

@AndrewC-B
Created May 31, 2017 23:46
Show Gist options
  • Save AndrewC-B/ad056f089aad0f10029a719f97871be6 to your computer and use it in GitHub Desktop.
Save AndrewC-B/ad056f089aad0f10029a719f97871be6 to your computer and use it in GitHub Desktop.
def main():
path_to_source = "input.txt"
output_directory = "output/"
with open(path_to_source, 'r') as source:
lines = source.readlines()
for i, line in enumerate(lines):
with open("{}file_{}.txt".format(output_directory, i), 'w+') as output:
output.write(line)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment