get_ip.py 227 B

123456789101112131415
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. import requests
  4. try:
  5. r = requests.get("https://ipinfo.io/ip")
  6. print(r.text, end="")
  7. except:
  8. print("No Connection", end="")
  9. # print(r.status_code)
  10. # print(r.json)