I want to make a program which is checks the given url for every 10 seconds
def listener(url):
print ("Status: Listening")
response = urllib.request.urlopen(url)
data = response.read()
text = data.decode('utf-8')
if text == 'Hello World. Testing!':
print("--Action Started!--")
t = Timer(10.0,listener('http://test.com/test.txt'))
t.start()
here is the output:
Status: Listening
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 1186, in run
self.function(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
It runs the function for one time, after 10 seconds the error appears