
January 16th, 2013, 10:45 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 6
Time spent in forums: 1 h 11 m 55 sec
Reputation Power: 0
|
|
|
Function self call- ok?
I am new to python. I am using python to check my gmail account for newly arrived messages. I want it to constantly check it every 10 seconds, for example. Is this function ok practice? Is there another way to do the perpetual check? Would it be better to use a while loop with an input exit strategy?
Code:
def checkMail(old,new):
now = int(g.get_mail_count())
curr = now - old
if curr > new:
new = curr
print "NEW"
time.sleep(10)
checkMail(old,new)
|