Oh I see. That was how the old API authentication used to work. That does not work anymore, you have to use the methods described in the official API docs.
Also note an access token only lasts for 8-24 hours. You must keep track of the token duration and generate a new one as needed.
I added a python sample to this topic. There are other ways to integrate OAuth2 in python but this will create you an access_token.