<filename>Clipboard.py
import argparse
import time

import pyperclip


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--file", help="File to save", default="/home/neo/Documents/clipboard.txt"
    )
    args = parser.parse_args()
    clipbord_place = args.file

    while True:
        clipboard = pyperclip.paste()
        with open(clipbord_place, "a") as file_write:
            with open(clipbord_place, "r") as file_read:
                file_content = file_read.read()
                if clipboard not in file_content:
                    file_write.write("\n" + clipboard)
                time.sleep(1)


if __name__ == "__main__":
    main()

<filename>Clipboard.py
import argparse
import time

import pyperclip


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--file", help="File to save", default="/home/neo/Documents/clipboard.txt"
    )
    args = parser.parse_args()
    clipbord_place = args.file

    while True:
        clipboard = pyperclip.paste()
        with open(clipbord_place, "a") as file_write:
            with open(clipbord_place, "r") as file_read:
                file_content = file_read.read()
                if clipboard not in file_content:
                    file_write.write("\n" + clipboard)
                time.sleep(1)


if __name__ == "__main__":
    main()
