For using 'curl ifconfig.me' in python you could use the PycURL library in python. This implementation would look like this:

'
import requests
url ="https://ifconfig.me/"
print url
'
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence