## Copyright 2023, Spirion LLC All Rights Reserved from sys import argv def write_match(file_path, match_location): f = open(file_path, "a+") f.write(f"MATCH FOUND: { match_location }\n") f.close() if __name__ == "__main__": # join input to handle spaces in file path match_location = " ".join(argv[1:]) file_path = "C:\\temp\\example.txt" write_match(file_path, match_location)