Posts

Showing posts from September, 2019

How to install packages in python using python program ?

                              How to install packages in python using python program (code)? import subprocess import sys def install(package): subprocess.call([sys.executable, "-m" , "pip" , "install" , package]) # Example if __name__ == '__main__' : a=[ 'tk' , 'sys' , 'shutil' , 'csv' , 'numpy' , 'pandas' , 'datetime' , 'time' , 'webbrowser' , 'PIL' , 'smtplib' , 'email' , 'subprocess' , 'cv2' , 'setup' , 'idna' , 'cx_Freeze' ] for i in range(len(a)): install(a[i]) ''' install('tk') install('sys') install('shutil') install('csv') install('numpy') install('pandas') install('datetime') install('time') install('webbrowser') install('PIL') install...

How to send Emails in CSV file and other types of files.

How to send Emails in CSV file and other types of files. First Program to simple to send email in normal text message :- import smtplib a= input ( "Print message to send" ) server = smtplib.SMTP( 'smtp.gmail.com' , 587 ) server.ehlo() server.starttls() server.login( 'Enter Sender Email ID' , "Passowrd for your email id" ) server.sendmail( 'Enter Sender Email ID' , 'Enter Reciver Email ID' , a) server.close() print ( "Sucefully" ) Second Program into to send Email in  CSV file and other type of files :- import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders fromaddr = "Enter Sender Emial" toaddr = "Enter Reciver Email" # instance of MIMEMultipart msg = MIMEMultipart() # storing the senders email address msg[ 'From' ] = fromaddr # storing the receivers email address msg...