Update mw.py

pull/109/head
midoks 4 years ago
parent 06e6102d18
commit 44657f9b2f
  1. 4
      class/core/mw.py

@ -554,8 +554,8 @@ def getLocalIp():
import urllib2 import urllib2
url = 'http://pv.sohu.com/cityjson?ie=utf-8' url = 'http://pv.sohu.com/cityjson?ie=utf-8'
opener = urllib2.urlopen(url) opener = urllib2.urlopen(url)
str = opener.read() content = opener.read()
ipaddress = re.search('\d+.\d+.\d+.\d+', str).group(0) ipaddress = re.search('\d+.\d+.\d+.\d+', content).group(0)
writeFile(filename, ipaddress) writeFile(filename, ipaddress)
ipaddress = re.search('\d+.\d+.\d+.\d+', ipaddress).group(0) ipaddress = re.search('\d+.\d+.\d+.\d+', ipaddress).group(0)

Loading…
Cancel
Save