I needed a simple way to scan and make QR-codes on my PC.This code will first show the menu to the user, where they can select either option 1 to generate a QR code or option 2 to scan a QR code. Once the user makes a choice, the corresponding function will be executed. After the function is finished, the after_choice() function will be called, which will prompt the user to choose whether they want to run the script again or not. If the user selects "yes", the start() function will be called again and the menu will be displayed. If the user selects "no", the script will print "Goodbye!" and end. If the user inputs something other than "yes" or "no", the script will print an error message and prompt the user again.
You might need to install the opencv library by running!pip install opencv-python-headlessin case you don't have it already.
Comments
Please log in or sign up to comment.