Created
June 15, 2017 09:56
-
-
Save anonymous/12b07be483d0b7d87e6e8ace75d86353 to your computer and use it in GitHub Desktop.
A really quick and dirty sorter for @robmanuel
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
print("Give me a path") | |
path = input() | |
file_object = open(path, "r") | |
keepers = [] | |
losers = [] | |
for line in file_object: | |
while True: | |
print(line) | |
print("Keep (0) or lose (1)") | |
ans = input() | |
if ans == "0": | |
keepers.append(line) | |
break | |
if ans == "1": | |
losers.append(line) | |
break | |
else: | |
print("Please give one of those 2 answers") | |
continue | |
print("keepers") | |
print(keepers) | |
print("losers") | |
print(losers) | |
keepersFile = open("keepers.txt", "w") | |
losersFile = open("losers.txt", "w") | |
for item in keepers: | |
keepersFile.write(item) | |
keepersFile.close() | |
for item in losers: | |
losersFile.write(item) | |
losersFile.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment