mardi 24 février 2015

Why is sched breaking apart my strings

I`m trying to use sched to run tweetsearch, function that takes one argument, a string.



s.enter(delaypercycle, 1, tweetsearch, "nike")
s.run()


This returns "TypeError: tweetsearch() takes exactly 1 argument (4 given)". Changing "nike" to "chicken" returns the same error, except with (7 given).


Any idea how to pass a string into sched?


Sample code that yields same error:



import sched, time
s = sched.scheduler(time.time, time.sleep)
def printword(word):
print word
While True:
s.enter(1, 1, printword, "chicken")
s.run

Aucun commentaire:

Enregistrer un commentaire