I tried ot take a full program and pare it down to a function within a program and I am sure something is wrong. Actually, since I am getting an error I know something is wrong. Here is the code:
Code:
import re, urllib2, sys, BaseHTTPServer
def getip():
web_handle = urllib2.urlopen(address)
address = parseAddress(sys.argv[1])
website_handle = retrieveWebPage(address)
website_text = website_handle.read()
foo = re.compile("(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,4})")
bar = website_text
ip = foo.findall(bar)
for finds in ip:
return finds
print finds
And this is the error I am getting
Code:
File "parse_example_try1", line 18
return finds
SyntaxError: 'return' outside function
If it is totally screwed up then I will have to try something different.