Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import pyttsx
- import smtplib
- from multiprocessing import Process
- dars = raw_input("name dars : ")
- zaman = input("zaman min : ")
- def countdown(t):
- while t >= 0:
- print(t)
- time.sleep(1)
- t -= 1
- print('Goodbye! \n')
- engine = pyttsx.init()
- engine.say('go and eat coffee')
- engine.runAndWait()
- # for i in range(0, 20):
- # engine = pyttsx.init()
- # engine.say('beeeeed')
- # engine.runAndWait()
- def sendEmail():
- try :
- for i in range(0,1) :
- print "sending... "
- smtpObj = smtplib.SMTP('smtp.live.com.', 587)
- smtpObj.ehlo()
- smtpObj.starttls()
- smtpObj.login('s_hamed_s@msn.com', 'tsfztsfzs856658')
- smtpObj.sendmail('s_hamed_s@msn.com','hamedsafikhani854@gmail.com', 'Subject: %s.\nThis message from python\t %s' %(dars,zaman))
- smtpObj.quit()
- print "send message successfully to s_hamed_s@msn.com"
- except:
- print "sending faild"
- if __name__ == '__main__':
- p1 = Process (target=sendEmail())
- p2 = Process (target=countdown(zaman*60))
- p2.start()
- p1.start()
- p1.join()
- p2.join()
- # sendEmail()
- # countdown(zaman * 60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement