First you need an oAuth loop
Either implicit or Authorization Code would suffice
Go implicit if you are building a webpage and don’t care about keeping the token.
You need a token with the relevant scope on it as documented by
Which is user_follow_edit
In python I believe the main function/library people use for making cURL style requests, is called, requests so you just need to be able to create a webpage that provides the frontfacing parts, and some code to make the oAuth hnadshake in the back and perform the actual follow.