Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2017 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/12b07be483d0b7d87e6e8ace75d86353 to your computer and use it in GitHub Desktop.
Save anonymous/12b07be483d0b7d87e6e8ace75d86353 to your computer and use it in GitHub Desktop.
A really quick and dirty sorter for @robmanuel
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