Posts

Showing posts from December, 2024

How to install mySQL Connector in Python? It's easy.

Image
 Hello! If you're here because you wanna know how to install mySQL Connector in Python. I've spent a good few hours painstakingly experimenting just to write this post. So enjoy your read! Python + MySQL  Sooo you'll need these things first off:- 1. Python with 'pip' (preferably Python 3.8) 2. MySQL Installation (with Workbench) I'm lazy to paste links so search them urself Already have Python but unsure if you have pip or not? In Command Prompt on Windows or Terminal on Mac, type and enter: pip --version . If pip version is shown then it is installed. If you're screen looks something like this after doing the check, just reinstall Python 3.8 again. lol. Also, another tip: when installing mySQL, make sure to download all the assets right away instead of customising the installation. I will soon post a follow-up because my head is hurting lol, (no one is going to read this anyways) bye

Do switch cases exist in Python?

 Yes, they do. In a slightly different way. Example: match input("enter 1 or 2"):       case "1":                  print("bye")        case "2":                   print("hai")        case _:    #For any other input, like 'else'                   print('invalid')