Skip to main content

Posts

Showing posts from December, 2020

Automatic Birthday mail sending with Python

  The first thing we do is import six libraries:   pandas datetime smtplib time requests win10toast   Apart from this, Also create an Excel sheet for containing records like this:  Name ,  Email ,  Contact ,  Birthday ,   and  Year .  Approach: For the sending email part, We define a  sendEmail()  function which will start a Gmail session, send the email, and quit the session.  For the SMS part, we must have an account on  www.fast2sms.com  from where we will get an API key. This API key is used to send SMS over mobile numbers using your account on fast2sms then We create a  sendsms()  function which will verify the API key and send SMS. In the driver code section, we read the data from Excel sheet and match today’s date with any of the birthdays. If there is a match, we call the  sendEmail()  and  sendsms()  functions and also we add the current year in the Excel sheet. Also, we hav...

Flip Tiles. Memory Game!

CODE : Check Out Our Instagram Page : Instagram.com/Python.Coderss   # import modules from random import * from turtle import * # set the screen screen = Screen() #choose background color screen.bgcolor("yellow") # define the function # for creating a square section # for the game def Square(x, y): up() goto(x, y) down() color('white', 'green') begin_fill() for count in range(4): forward(50) left(90) end_fill() # define functionn to # keep a check of index number def Numbering(x, y): return int((x + 200) // 50 + ((y + 200) // 50) * 8) # define function def Coordinates(count): return (count % 8) * 50 - 200, (count // 8) * 50 - 200 # define function # to make it interactive # user click def click(x, y): spot = Numbering(x, y) mark = state['mark'] if mark is None or mark == spot or tiles[mark] != tiles[spot]: state['mark'] = spot else: hide[spot] = False hide[mark] = False state[...

Corona Virus Live Updates for India – Using Python

Check Out Our Instagram Page :  Instagram.com/Python.Coderss     As we know the whole world is being affected by the COVID-19 pandemic and almost everyone is working from home. We all should utilize this duration at best, to improve our technical skills or writing some good Pythonic scripts.  Let’s see a simple Python script to demonstrate the state-wise coronavirus cases in India. This Python script fetches the live data from the Ministry of Health Affairs Official Website. Then data is represented in the horizontal bar graph. To run this script follow the below installation –    $ pip install bs4 $ pip install tabulate $ pip install matplotlib $ pip install numpy $ pip install requests Let’s try to execute the script step-by-step.   Step #1: # importing libraries   import requests from bs4 import BeautifulSoup from tabulate import tabulate import os import numpy as np import matplotlib.pyplot as plt Step #2:  extract_contents ...