diff --git a/System-Automation-Scripts/qrGenerator/README.md b/System-Automation-Scripts/qrGenerator/README.md new file mode 100644 index 00000000..11f28139 --- /dev/null +++ b/System-Automation-Scripts/qrGenerator/README.md @@ -0,0 +1,5 @@ +# qrGenerator + +- A Python Script that asks the user to input an URL or any string of characters and then coverts it to a QR code as the name of the URL domain, saved locally in the current working directory or as specified by the user. +- Also, if the program finds an existing QR with the same filename, it creates a new one with a random number at the end of the filename. +- Can be used either in the Command Line or within the Python IDE diff --git a/System-Automation-Scripts/qrGenerator.py b/System-Automation-Scripts/qrGenerator/qrGenerator.py similarity index 65% rename from System-Automation-Scripts/qrGenerator.py rename to System-Automation-Scripts/qrGenerator/qrGenerator.py index afcf9f08..65fd4728 100644 --- a/System-Automation-Scripts/qrGenerator.py +++ b/System-Automation-Scripts/qrGenerator/qrGenerator.py @@ -5,16 +5,16 @@ import random if len(argv)==2: - url = str(argv[1]) + url = str(argv[1]) else: - url = input("Enter an URL to Encode in QR: ") + url = input("Enter an URL to Encode in QR: ") path = ((urlparse(url)).netloc) image = qrcode.make(url) if os.path.exists(f"{path}.png"): - path = path + str(random.randint(0,1000)) + path = path + str(random.randint(0,10000)) image.save(f"{path}.png", "PNG") file_path = os.path.abspath(path) -print("File saved to:", file_path) +print("File saved to:", file_path) \ No newline at end of file