Examples of authenticating in Python with requests instead of curl

Would I take these same steps if I’m just executing a script locally in a text editor rather than a website?