How can I get the public IP using python2.7? Not private IP.
You can just do this:
import requests print requests.get("http://ipecho.net/plain?").text
Produces:
XX.XX.XXX.XXX