hi everyone
so I am trying to do something after waiting a random number of seconds in a while loop.I have python22 installed and I am working on windows xp. The problem is that it time.sleep works fine the first time but returns the following error after that. I dont understand why that could be.
Traceback (most recent call last):
File "testing.py", line 11, in ?
time.sleep(wait)
AttributeError: 'unicode' object has no attribute 'sleep'
import feedparser, string, os, time, smtplib,platform,random
timeholder = ''
while 1:
wait = random.uniform(60, 121)
time.sleep(wait)
print "fetching now"
# do something
# If new post update time
if timeholder != time:
timeholder = time
print "New post at " + timeholder
# If no new posts do nothing
elif timeholder == time:
pass