Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. import time
  2. import pyttsx
  3. import smtplib
  4. from multiprocessing import Process
  5.  
  6. dars = raw_input("name dars : ")
  7. zaman = input("zaman min : ")
  8.  
  9.  
  10.  
  11. def countdown(t):
  12.  
  13. while t >= 0:
  14. print(t)
  15. time.sleep(1)
  16. t -= 1
  17. print('Goodbye! \n')
  18. engine = pyttsx.init()
  19. engine.say('go and eat coffee')
  20. engine.runAndWait()
  21. # for i in range(0, 20):
  22. # engine = pyttsx.init()
  23. # engine.say('beeeeed')
  24. # engine.runAndWait()
  25.  
  26. def sendEmail():
  27.  
  28. try :
  29.  
  30. for i in range(0,1) :
  31. print "sending... "
  32.  
  33. smtpObj = smtplib.SMTP('smtp.live.com.', 587)
  34. smtpObj.ehlo()
  35.  
  36. smtpObj.starttls()
  37.  
  38. smtpObj.login('s_hamed_s@msn.com', 'tsfztsfzs856658')
  39. smtpObj.sendmail('s_hamed_s@msn.com','hamedsafikhani854@gmail.com', 'Subject: %s.\nThis message from python\t %s' %(dars,zaman))
  40.  
  41.  
  42. smtpObj.quit()
  43. print "send message successfully to s_hamed_s@msn.com"
  44.  
  45. except:
  46. print "sending faild"
  47.  
  48. if __name__ == '__main__':
  49. p1 = Process (target=sendEmail())
  50.  
  51. p2 = Process (target=countdown(zaman*60))
  52. p2.start()
  53. p1.start()
  54.  
  55. p1.join()
  56. p2.join()
  57.  
  58. # sendEmail()
  59. # countdown(zaman * 60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement