How to only allow number as input? - Python : <p>I want to make a simple Python IP Tracker with IP Format only, but i'm confused cause i can't filter the input. 
This is my code:</p>

<pre><code>while True:
    ip= raw_input("What Your Target IP : ")
    url = "http://blabla.com/json/"
    response = urllib2.urlopen(url + ip)
    data = response.read()
    values = json.loads(data)

    print("------------------------------------")
    print "\r"
    print(" IP: " + values['query'])
    print(" City: " + values['city'])
    print(" Region: " + values['regionName'])
    print(" Country: " + values['country'])
    print(" Time Zone: " + values['timezone'])
    print "\r"

    break
</code></pre>
