How do I get Authorization code?

So i’m able to redirect and have “Authorized” like this

So next time when I paste the URL in browser I get the code but the same if I want to do it with Python can you suggest what I should be doing?