A few weeks ago I was getting a similar weird issue where I was testing an isolated snippet of code involving the <code>time.sleep()</code> command for inclusion in my actual program. I found that the code ran perfectly when tested as an isolated snippet but as soon as I threw it into the main program I ran into the problem of <code>time.sleep(1)</code> throwing a <code>TypeError: Expected callable/function</code> even though I was providing it with the correct argument type; an integer. So not knowing what was causing the issue, I decided just to play along and implement a hacky fix by providing a lambda returning the value I wanted. Then another TypeError popped up, this time asking for a float (?) instead of a function. So I just wrote a try: .. except: .. tree to handle the type errors. Mine ending up looking something like this:
from time import sleep
try:
sleep(1)
except:
try:
sleep(lambda: 1)
except:
sleep(float(1))
This ended up fixing my issue and after I provided it with a float it didn't throw any more type errors.
TLDR;
Not sure how to fix it for yours since passing <code>lambda: ">>>>>>=======true"</code> to the print statement will just make it print the function object but maybe you could try using the <code>print()</code> function from the <code>future</code> module. Something like this?
from __future__ import print_function
def main():
def timerCount():
lastTimeSince=0
arbitrary = 345
for i in xrange(arbitrary):
print(">>>>>>=======true")
timenow = time.time()
timeThen= 1421929025.21
timeSince = timenow-timeThen
if lastTimeSince <= round(timeSince,0):
changingLabel1.text=str(int(round(timeSince,0)))
lastTimeSince = round(timeSince,0)
return lastTimeSince