-
-
Save crabcrabcam/53c014b4a5a999ad564ebef1725e14c9 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