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
import sys | |
textfile=sys.argv[1] | |
param=sys.argv[2] | |
with open(textfile, "r+") as t: | |
for line in t: | |
if param in line: | |
print("It's already there") | |
break | |
else: | |
t.write(param + "\n") |