Description stringlengths 9 105 | Link stringlengths 45 135 | Code stringlengths 10 26.8k | Test_Case stringlengths 9 202 | Merge stringlengths 63 27k |
|---|---|---|---|---|
Desktop Notifier in Python | https://www.geeksforgeeks.org/desktop-notifier-python/ | import time
import notify2
from topnews import topStories
# path to notification window icon
ICON_PATH = "put full path to icon image here"
# fetch news items
newsitems = topStories()
# initialise the d-bus connection
notify2.init("News Notifier")
# create Notification object
n = notify2.Notification(None, icon=ICO... |
#Output : {'description': 'Months after it was first reported, the feud between Dwayne Johnson and
| Desktop Notifier in Python
import time
import notify2
from topnews import topStories
# path to notification window icon
ICON_PATH = "put full path to icon image here"
# fetch news items
newsitems = topStories()
# initialise the d-bus connection
notify2.init("News Notifier")
# create Notification object
n = notify2.... |
Get Live Weather Desktop Notifications Using Python | https://www.geeksforgeeks.org/get-live-weather-desktop-notifications-using-python/ | import requests
from bs4 import BeautifulSoup
from win10toast import ToastNotifier |
#Output : pip install bs4 | Get Live Weather Desktop Notifications Using Python
import requests
from bs4 import BeautifulSoup
from win10toast import ToastNotifier
#Output : pip install bs4
[END] |
Get Live Weather Desktop Notifications Using Python | https://www.geeksforgeeks.org/get-live-weather-desktop-notifications-using-python/ | n = ToastNotifier() |
#Output : pip install bs4 | Get Live Weather Desktop Notifications Using Python
n = ToastNotifier()
#Output : pip install bs4
[END] |
Get Live Weather Desktop Notifications Using Python | https://www.geeksforgeeks.org/get-live-weather-desktop-notifications-using-python/ | def getdata(url):
r = requests.get(url)
return r.text |
#Output : pip install bs4 | Get Live Weather Desktop Notifications Using Python
def getdata(url):
r = requests.get(url)
return r.text
#Output : pip install bs4
[END] |
Get Live Weather Desktop Notifications Using Python | https://www.geeksforgeeks.org/get-live-weather-desktop-notifications-using-python/ | htmldata = getdata(
"https://weather.com/en-IN/weather/today/l/25.59,85.14?par=google&temp=c/"
)
soup = BeautifulSoup(htmldata, "html.parser")
print(soup.prettify()) |
#Output : pip install bs4 | Get Live Weather Desktop Notifications Using Python
htmldata = getdata(
"https://weather.com/en-IN/weather/today/l/25.59,85.14?par=google&temp=c/"
)
soup = BeautifulSoup(htmldata, "html.parser")
print(soup.prettify())
#Output : pip install bs4
[END] |
Get Live Weather Desktop Notifications Using Python | https://www.geeksforgeeks.org/get-live-weather-desktop-notifications-using-python/ | current_temp = soup.find_all(
"span",
class_=" _-_-components-src-organism-CurrentConditions-CurrentConditions--tempValue--MHmYY",
)
chances_rain = soup.find_all(
"div",
class_="_-_-components-src-organism-CurrentConditions-CurrentConditions--precipValue--2aJSf",
)
temp = str(current_temp)
temp_rain = ... |
#Output : pip install bs4 | Get Live Weather Desktop Notifications Using Python
current_temp = soup.find_all(
"span",
class_=" _-_-components-src-organism-CurrentConditions-CurrentConditions--tempValue--MHmYY",
)
chances_rain = soup.find_all(
"div",
class_="_-_-components-src-organism-CurrentConditions-CurrentConditions--precipVal... |
Get Live Weather Desktop Notifications Using Python | https://www.geeksforgeeks.org/get-live-weather-desktop-notifications-using-python/ | n.show_toast("Weather update", result, duration=10) |
#Output : pip install bs4 | Get Live Weather Desktop Notifications Using Python
n.show_toast("Weather update", result, duration=10)
#Output : pip install bs4
[END] |
Get Live Weather Desktop Notifications Using Python | https://www.geeksforgeeks.org/get-live-weather-desktop-notifications-using-python/ | # import required libraries
import requests
from bs4 import BeautifulSoup
from win10toast import ToastNotifier
# create an object to ToastNotifier class
n = ToastNotifier()
# define a function
def getdata(url):
r = requests.get(url)
return r.text
htmldata = getdata(
"https://weather.com/en-IN/weather/t... |
#Output : pip install bs4 | Get Live Weather Desktop Notifications Using Python
# import required libraries
import requests
from bs4 import BeautifulSoup
from win10toast import ToastNotifier
# create an object to ToastNotifier class
n = ToastNotifier()
# define a function
def getdata(url):
r = requests.get(url)
return r.text
htmldata... |
How to use pynput to make a Keylogger? | https://www.geeksforgeeks.org/how-to-use-pynput-to-make-a-keylogger/ | # keylogger using pynput module????????????import pynputfrom pynput.keyboard import Key, Listener????????????keys = []????????????def on_press(key):??????????????????????????????????????????????????????keys.append(key)????????????????????????write_file(keys)??????????????????????????????????????????????????????try:????... |
#Output : pip install pynput | How to use pynput to make a Keylogger?
# keylogger using pynput module????????????import pynputfrom pynput.keyboard import Key, Listener????????????keys = []????????????def on_press(key):??????????????????????????????????????????????????????keys.append(key)????????????????????????write_file(keys)???????????????????????... |
Python - Cows and Bull | https://www.geeksforgeeks.org/python-cows-and-bulls-game/ | # Import required module
import random
# Returns list of digits
# of a number
def getDigits(num):
return [int(i) for i in str(num)]
# Returns True if number has
# no duplicate digits
# otherwise False
def noDuplicates(num):
num_li = getDigits(num)
if len(num_li) == len(set(num_li)):
return True
... |
#Output : Secret Code: 3768
| Python - Cows and Bull
# Import required module
import random
# Returns list of digits
# of a number
def getDigits(num):
return [int(i) for i in str(num)]
# Returns True if number has
# no duplicate digits
# otherwise False
def noDuplicates(num):
num_li = getDigits(num)
if len(num_li) == len(set(num_l... |
Simple Attendance Tracker using Python | https://www.geeksforgeeks.org/simple-attendance-tracker-using-python/ | def savefile():
book.save(r"<your-path>\attendance.xlsx")
print("saved!") |
#Output : 1--->CI
| Simple Attendance Tracker using Python
def savefile():
book.save(r"<your-path>\attendance.xlsx")
print("saved!")
#Output : 1--->CI
[END] |
Simple Attendance Tracker using Python | https://www.geeksforgeeks.org/simple-attendance-tracker-using-python/ | def check(no_of_days, row_num, b):
# to use the globally declared lists and strings
global staff_mails
global l2
global l3 |
#Output : 1--->CI
| Simple Attendance Tracker using Python
def check(no_of_days, row_num, b):
# to use the globally declared lists and strings
global staff_mails
global l2
global l3
#Output : 1--->CI
[END] |
Simple Attendance Tracker using Python | https://www.geeksforgeeks.org/simple-attendance-tracker-using-python/ | # for students
def mailstu(li, msg):
from_id = "cXXXXXXXXXs@gmail.com"
pwd = "XXXXXXXXXXXXX"
s = smtplib.SMTP("smtp.gmail.com", 587)
s.starttls()
s.login(from_id, pwd)
# for each student to warn send mail
for i in range(0, len(li)):
to_id = li[i]
message = MIMEMultipart()
... |
#Output : 1--->CI
| Simple Attendance Tracker using Python
# for students
def mailstu(li, msg):
from_id = "cXXXXXXXXXs@gmail.com"
pwd = "XXXXXXXXXXXXX"
s = smtplib.SMTP("smtp.gmail.com", 587)
s.starttls()
s.login(from_id, pwd)
# for each student to warn send mail
for i in range(0, len(li)):
to_id = li[... |
Simple Attendance Tracker using Python | https://www.geeksforgeeks.org/simple-attendance-tracker-using-python/ | import openpyxl
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# loading the excel sheet
book = openpyxl.load_workbook("D:\\attendance.xlsx")
# Choose the sheet
sheet = book["Sheet1"]
# counting number of rows / students
r = sheet.max_row
# variable for looping fo... |
#Output : 1--->CI
| Simple Attendance Tracker using Python
import openpyxl
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# loading the excel sheet
book = openpyxl.load_workbook("D:\\attendance.xlsx")
# Choose the sheet
sheet = book["Sheet1"]
# counting number of rows / students
r = s... |
Fun Fact Generator Web App in Python | https://www.geeksforgeeks.org/fun-fact-generator-web-app-in-python/ | # import the following modulesimport jsonimport requestsfrom pywebio.input import *from pywebio.output import *from pywebio.session import *????????????????????????def get_fun_fact(_):????????????????????????????????????????????????# Clear the "<p align=""left""><h2><img src=""https://\?????????????????????????????????... |
#Output : pip install pywebio | Fun Fact Generator Web App in Python
# import the following modulesimport jsonimport requestsfrom pywebio.input import *from pywebio.output import *from pywebio.session import *????????????????????????def get_fun_fact(_):????????????????????????????????????????????????# Clear the "<p align=""left""><h2><img src=""https... |
Creating payment receipts using Python | https://www.geeksforgeeks.org/creating-payment-receipts-using-python/ | # imports module
from reportlab.platypus import SimpleDocTemplate, Table, Paragraph, TableStyle
from reportlab.lib import colors
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet
# data which we are going to display as tables
DATA = [
["Date", "Name", "Subscription", "Pric... |
#Output : pip install reportlab | Creating payment receipts using Python
# imports module
from reportlab.platypus import SimpleDocTemplate, Table, Paragraph, TableStyle
from reportlab.lib import colors
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet
# data which we are going to display as tables
DATA = [
... |
Convert emoji into text in Python | https://www.geeksforgeeks.org/convert-emoji-into-text-in-python/ | import demoji
demoji.download_codes() |
#Output : pip install demoji | Convert emoji into text in Python
import demoji
demoji.download_codes()
#Output : pip install demoji
[END] |
Create a Voice Recorder using Python | https://www.geeksforgeeks.org/create-a-voice-recorder-using-python/ | # import required libraries
import sounddevice as sd
from scipy.io.wavfile import write
import wavio as wv
# Sampling frequency
freq = 44100
# Recording duration
duration = 5
# Start recorder with the given values
# of duration and sample frequency
recording = sd.rec(int(duration * freq), samplerate=freq, channels=2... |
#Output : pip install wavio | Create a Voice Recorder using Python
# import required libraries
import sounddevice as sd
from scipy.io.wavfile import write
import wavio as wv
# Sampling frequency
freq = 44100
# Recording duration
duration = 5
# Start recorder with the given values
# of duration and sample frequency
recording = sd.rec(int(duration... |
Create a Screen recorder using Python | https://www.geeksforgeeks.org/create-a-screen-recorder-using-python/ | # importing the required packages
import pyautogui
import cv2
import numpy as np |
#Output : pip install numpy | Create a Screen recorder using Python
# importing the required packages
import pyautogui
import cv2
import numpy as np
#Output : pip install numpy
[END] |
Create a Screen recorder using Python | https://www.geeksforgeeks.org/create-a-screen-recorder-using-python/ | # Specify resolution
resolution = (1920, 1080)
# Specify video codec
codec = cv2.VideoWriter_fourcc(*"XVID")
# Specify name of Output file
filename = "Recording.avi"
# Specify frames rate. We can choose
# any value and experiment with it
fps = 60.0
# Creating a VideoWriter object
out = cv2.VideoWriter(filename, cod... |
#Output : pip install numpy | Create a Screen recorder using Python
# Specify resolution
resolution = (1920, 1080)
# Specify video codec
codec = cv2.VideoWriter_fourcc(*"XVID")
# Specify name of Output file
filename = "Recording.avi"
# Specify frames rate. We can choose
# any value and experiment with it
fps = 60.0
# Creating a VideoWriter obje... |
Create a Screen recorder using Python | https://www.geeksforgeeks.org/create-a-screen-recorder-using-python/ | # Create an Empty window
cv2.namedWindow("Live", cv2.WINDOW_NORMAL)
# Resize this window
cv2.resizeWindow("Live", 480, 270) |
#Output : pip install numpy | Create a Screen recorder using Python
# Create an Empty window
cv2.namedWindow("Live", cv2.WINDOW_NORMAL)
# Resize this window
cv2.resizeWindow("Live", 480, 270)
#Output : pip install numpy
[END] |
Create a Screen recorder using Python | https://www.geeksforgeeks.org/create-a-screen-recorder-using-python/ | while True:
# Take screenshot using PyAutoGUI
img = pyautogui.screenshot()
# Convert the screenshot to a numpy array
frame = np.array(img)
# Convert it from BGR(Blue, Green, Red) to
# RGB(Red, Green, Blue)
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# Write it to the output file
... |
#Output : pip install numpy | Create a Screen recorder using Python
while True:
# Take screenshot using PyAutoGUI
img = pyautogui.screenshot()
# Convert the screenshot to a numpy array
frame = np.array(img)
# Convert it from BGR(Blue, Green, Red) to
# RGB(Red, Green, Blue)
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)... |
Create a Screen recorder using Python | https://www.geeksforgeeks.org/create-a-screen-recorder-using-python/ | # Release the Video writer
out.release()
# Destroy all windows
cv2.destroyAllWindows() |
#Output : pip install numpy | Create a Screen recorder using Python
# Release the Video writer
out.release()
# Destroy all windows
cv2.destroyAllWindows()
#Output : pip install numpy
[END] |
Create a Screen recorder using Python | https://www.geeksforgeeks.org/create-a-screen-recorder-using-python/ | # importing the required packages
import pyautogui
import cv2
import numpy as np
# Specify resolution
resolution = (1920, 1080)
# Specify video codec
codec = cv2.VideoWriter_fourcc(*"XVID")
# Specify name of Output file
filename = "Recording.avi"
# Specify frames rate. We can choose any
# value and experiment with ... |
#Output : pip install numpy | Create a Screen recorder using Python
# importing the required packages
import pyautogui
import cv2
import numpy as np
# Specify resolution
resolution = (1920, 1080)
# Specify video codec
codec = cv2.VideoWriter_fourcc(*"XVID")
# Specify name of Output file
filename = "Recording.avi"
# Specify frames rate. We can c... |
How to Build a Simple Auto-Login Bot with Python | https://www.geeksforgeeks.org/how-to-build-a-simple-auto-login-bot-with-python/ | # Used to import the webdriver from selenium
from selenium import webdriver
import os
# Get the path of chromedriver which you have install
def startBot(username, password, url):
path = "C:\\Users\\hp\\Downloads\\chromedriver"
# giving the path of chromedriver to selenium webdriver
driver = webdriver.Ch... |
#Output : pip install selenium | How to Build a Simple Auto-Login Bot with Python
# Used to import the webdriver from selenium
from selenium import webdriver
import os
# Get the path of chromedriver which you have install
def startBot(username, password, url):
path = "C:\\Users\\hp\\Downloads\\chromedriver"
# giving the path of chromedrive... |
Make a Twitter Bot in Python | https://www.geeksforgeeks.org/how-to-make-a-twitter-bot-in-python/ | import tweepy
from time import sleep
from credentials import *
from config import QUERY, FOLLOW, LIKE, SLEEP_TIME
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
print("Twitter bot which retweets, like tweets and follow users")
... |
#Output : $ pip install tweepy
| Make a Twitter Bot in Python
import tweepy
from time import sleep
from credentials import *
from config import QUERY, FOLLOW, LIKE, SLEEP_TIME
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
print("Twitter bot which retweets, li... |
Make a Twitter Bot in Python | https://www.geeksforgeeks.org/how-to-make-a-twitter-bot-in-python/ | # Edit this config.py file as you like
# This is hastag which Twitter bot will
# search and retweet You can edit this with
# any hastag .For example : '# javascript'
QUERY = "# anything"
# Twitter bot setting for liking Tweets
LIKE = True
# Twitter bot setting for following user who tweeted
FOLLOW = True
# Twitter... |
#Output : $ pip install tweepy
| Make a Twitter Bot in Python
# Edit this config.py file as you like
# This is hastag which Twitter bot will
# search and retweet You can edit this with
# any hastag .For example : '# javascript'
QUERY = "# anything"
# Twitter bot setting for liking Tweets
LIKE = True
# Twitter bot setting for following user who twe... |
Make a Twitter Bot in Python | https://www.geeksforgeeks.org/how-to-make-a-twitter-bot-in-python/ | # This is just a sample file. You need to
# edit this file. You need to get these
# details from your Twitter app settings.
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = "" |
#Output : $ pip install tweepy
| Make a Twitter Bot in Python
# This is just a sample file. You need to
# edit this file. You need to get these
# details from your Twitter app settings.
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
#Output : $ pip install tweepy
[END] |
Building WhatsApp bot on Python | https://www.geeksforgeeks.org/building-whatsapp-bot-on-python/ | from flask import Flask, request
import requests
from twilio.twiml.messaging_response import MessagingResponse |
#Output : mkdir geeks-bot && cd geeks-bot | Building WhatsApp bot on Python
from flask import Flask, request
import requests
from twilio.twiml.messaging_response import MessagingResponse
#Output : mkdir geeks-bot && cd geeks-bot
[END] |
Building WhatsApp bot on Python | https://www.geeksforgeeks.org/building-whatsapp-bot-on-python/ | from flask import request
incoming_msg = request.values.get("Body", "").lower() |
#Output : mkdir geeks-bot && cd geeks-bot | Building WhatsApp bot on Python
from flask import request
incoming_msg = request.values.get("Body", "").lower()
#Output : mkdir geeks-bot && cd geeks-bot
[END] |
Building WhatsApp bot on Python | https://www.geeksforgeeks.org/building-whatsapp-bot-on-python/ | from twilio.twiml.messaging_response import MessagingResponse??????response = MessagingResponse()msg = response.message()msg.body('this is the response/reply?????? from t |
#Output : mkdir geeks-bot && cd geeks-bot | Building WhatsApp bot on Python
from twilio.twiml.messaging_response import MessagingResponse??????response = MessagingResponse()msg = response.message()msg.body('this is the response/reply?????? from t
#Output : mkdir geeks-bot && cd geeks-bot
[END] |
Building WhatsApp bot on Python | https://www.geeksforgeeks.org/building-whatsapp-bot-on-python/ | # chatbot logic
def bot():
# user input
user_msg = request.values.get("Body", "").lower()
# creating object of MessagingResponse
response = MessagingResponse()
# User Query
q = user_msg + "geeksforgeeks.org"
# list to store urls
result = []
# searching and storing urls
for i ... |
#Output : mkdir geeks-bot && cd geeks-bot | Building WhatsApp bot on Python
# chatbot logic
def bot():
# user input
user_msg = request.values.get("Body", "").lower()
# creating object of MessagingResponse
response = MessagingResponse()
# User Query
q = user_msg + "geeksforgeeks.org"
# list to store urls
result = []
# searc... |
Building WhatsApp bot on Python | https://www.geeksforgeeks.org/building-whatsapp-bot-on-python/ | from flask import Flask
from googlesearch import search
import requests
from twilio.twiml.messaging_response import MessagingResponse
app = Flask(__name__)
@app.route("/", methods=["POST"])
# chatbot logic
def bot():
# user input
user_msg = request.values.get("Body", "").lower()
# creating object of M... |
#Output : mkdir geeks-bot && cd geeks-bot | Building WhatsApp bot on Python
from flask import Flask
from googlesearch import search
import requests
from twilio.twiml.messaging_response import MessagingResponse
app = Flask(__name__)
@app.route("/", methods=["POST"])
# chatbot logic
def bot():
# user input
user_msg = request.values.get("Body", "").low... |
Create a Telementsegram Bot using Python | https://www.geeksforgeeks.org/create-a-telegram-bot-using-python/ | from telegram.ext.updater import Updater
from telegram.update import Update
from telegram.ext.callbackcontext import CallbackContext
from telegram.ext.commandhandler import CommandHandler
from telegram.ext.messagehandler import MessageHandler
from telegram.ext.filters import Filters |
#Output : # installing via pip
| Create a Telementsegram Bot using Python
from telegram.ext.updater import Updater
from telegram.update import Update
from telegram.ext.callbackcontext import CallbackContext
from telegram.ext.commandhandler import CommandHandler
from telegram.ext.messagehandler import MessageHandler
from telegram.ext.filters import Fil... |
Create a Telementsegram Bot using Python | https://www.geeksforgeeks.org/create-a-telegram-bot-using-python/ | updater = Updater("your_own_API_Token got from BotFather", use_context=True)
def start(update: Update, context: CallbackContext):
update.message.reply_text(
"Enter the text you want to show to the user whenever they start the bot"
) |
#Output : # installing via pip
| Create a Telementsegram Bot using Python
updater = Updater("your_own_API_Token got from BotFather", use_context=True)
def start(update: Update, context: CallbackContext):
update.message.reply_text(
"Enter the text you want to show to the user whenever they start the bot"
)
#Output : # installing vi... |
Create a Telementsegram Bot using Python | https://www.geeksforgeeks.org/create-a-telegram-bot-using-python/ | def help(update: Update, context: CallbackContext):
update.message.reply_text("Your Message") |
#Output : # installing via pip
| Create a Telementsegram Bot using Python
def help(update: Update, context: CallbackContext):
update.message.reply_text("Your Message")
#Output : # installing via pip
[END] |
Create a Telementsegram Bot using Python | https://www.geeksforgeeks.org/create-a-telegram-bot-using-python/ | def gmail_url(update: Update, context: CallbackContext):
update.message.reply_text("gmail link here")
def youtube_url(update: Update, context: CallbackContext):
update.message.reply_text("youtube link")
def linkedIn_url(update: Update, context: CallbackContext):
update.message.reply_text("Your linkedin ... |
#Output : # installing via pip
| Create a Telementsegram Bot using Python
def gmail_url(update: Update, context: CallbackContext):
update.message.reply_text("gmail link here")
def youtube_url(update: Update, context: CallbackContext):
update.message.reply_text("youtube link")
def linkedIn_url(update: Update, context: CallbackContext):
... |
Create a Telementsegram Bot using Python | https://www.geeksforgeeks.org/create-a-telegram-bot-using-python/ | updater.dispatcher.add_handler(CommandHandler("start", start))
updater.dispatcher.add_handler(CommandHandler("youtube", youtube_url))
updater.dispatcher.add_handler(CommandHandler("help", help))
updater.dispatcher.add_handler(CommandHandler("linkedin", linkedIn_url))
updater.dispatcher.add_handler(CommandHandler("gmail... |
#Output : # installing via pip
| Create a Telementsegram Bot using Python
updater.dispatcher.add_handler(CommandHandler("start", start))
updater.dispatcher.add_handler(CommandHandler("youtube", youtube_url))
updater.dispatcher.add_handler(CommandHandler("help", help))
updater.dispatcher.add_handler(CommandHandler("linkedin", linkedIn_url))
updater.dis... |
Create a Telementsegram Bot using Python | https://www.geeksforgeeks.org/create-a-telegram-bot-using-python/ | updater.start_polling() |
#Output : # installing via pip
| Create a Telementsegram Bot using Python
updater.start_polling()
#Output : # installing via pip
[END] |
Create a Telementsegram Bot using Python | https://www.geeksforgeeks.org/create-a-telegram-bot-using-python/ | from telegram.ext.updater import Updater
from telegram.update import Update
from telegram.ext.callbackcontext import CallbackContext
from telegram.ext.commandhandler import CommandHandler
from telegram.ext.messagehandler import MessageHandler
from telegram.ext.filters import Filters
updater = Updater("your_own_API_Tok... |
#Output : # installing via pip
| Create a Telementsegram Bot using Python
from telegram.ext.updater import Updater
from telegram.update import Update
from telegram.ext.callbackcontext import CallbackContext
from telegram.ext.commandhandler import CommandHandler
from telegram.ext.messagehandler import MessageHandler
from telegram.ext.filters import Fil... |
Twitter Sentiment Analysis using Python | https://www.geeksforgeeks.org/twitter-sentiment-analysis-using-python/ | import reimport tweepyfrom tweepy import OAuthHandlerfrom textblob import TextBlob??????class TwitterClient(object):????????????????????????'''????????????????????????Generic Twitter Class for sentiment analysis.????????????????????????'''????????????????????????def __init__(self):??????????????????????????????????????... |
#Output : pip install tweepy | Twitter Sentiment Analysis using Python
import reimport tweepyfrom tweepy import OAuthHandlerfrom textblob import TextBlob??????class TwitterClient(object):????????????????????????'''????????????????????????Generic Twitter Class for sentiment analysis.????????????????????????'''????????????????????????def __init__(self... |
Employee Management System using Python | https://www.geeksforgeeks.org/employee-management-system-using-python/ | import mysql.connector
con = mysql.connector.connect(
host="localhost", user="root", password="password", database="emp"
) |
#Output : pip install mysqlconnector | Employee Management System using Python
import mysql.connector
con = mysql.connector.connect(
host="localhost", user="root", password="password", database="emp"
)
#Output : pip install mysqlconnector
[END] |
Employee Management System using Python | https://www.geeksforgeeks.org/employee-management-system-using-python/ | # Function To Check if Employee with
# given Id Exist or Not
def check_employee(employee_id):
# Query to select all Rows f
# rom employee Table
sql = "select * from empd where id=%s"
# making cursor buffered to make
# rowcount method work properly
c = con.cursor(buffered=True)
data = (emp... |
#Output : pip install mysqlconnector | Employee Management System using Python
# Function To Check if Employee with
# given Id Exist or Not
def check_employee(employee_id):
# Query to select all Rows f
# rom employee Table
sql = "select * from empd where id=%s"
# making cursor buffered to make
# rowcount method work properly
c = c... |
Employee Management System using Python | https://www.geeksforgeeks.org/employee-management-system-using-python/ | # Function to mAdd_Employee
def Add_Employ():
Id = input("Enter Employee Id : ")
# Checking if Employee with given Id
# Already Exist or Not
if check_employee(Id) == True:
print("Employee already exists\nTry Again\n")
menu()
else:
Name = input("Enter Employee Name : ")
... |
#Output : pip install mysqlconnector | Employee Management System using Python
# Function to mAdd_Employee
def Add_Employ():
Id = input("Enter Employee Id : ")
# Checking if Employee with given Id
# Already Exist or Not
if check_employee(Id) == True:
print("Employee already exists\nTry Again\n")
menu()
else:
N... |
Employee Management System using Python | https://www.geeksforgeeks.org/employee-management-system-using-python/ | # Function to Remove Employee with given Id
def Remove_Employ():
Id = input("Enter Employee Id : ")
# Checking if Employee with given Id
# Exist or Not
if check_employee(Id) == False:
print("Employee does not exists\nTry Again\n")
menu()
else:
# Query to Delete Employee fr... |
#Output : pip install mysqlconnector | Employee Management System using Python
# Function to Remove Employee with given Id
def Remove_Employ():
Id = input("Enter Employee Id : ")
# Checking if Employee with given Id
# Exist or Not
if check_employee(Id) == False:
print("Employee does not exists\nTry Again\n")
menu()
els... |
Employee Management System using Python | https://www.geeksforgeeks.org/employee-management-system-using-python/ | # Function to Promote Employee
def Promote_Employee():
Id = int(input("Enter Employ's Id"))
# Checking if Employee with given Id
# Exist or Not
if check_employee(Id) == False:
print("Employee does not exists\nTry Again\n")
menu()
else:
Amount = int(input("Enter increase in ... |
#Output : pip install mysqlconnector | Employee Management System using Python
# Function to Promote Employee
def Promote_Employee():
Id = int(input("Enter Employ's Id"))
# Checking if Employee with given Id
# Exist or Not
if check_employee(Id) == False:
print("Employee does not exists\nTry Again\n")
menu()
else:
... |
Employee Management System using Python | https://www.geeksforgeeks.org/employee-management-system-using-python/ | # Function to Display All Employees
# from Employee Table
def Display_Employees():
# query to select all rows from
# Employee Table
sql = "select * from empd"
c = con.cursor()
# Executing the SQL Query
c.execute(sql)
# Fetching all details of all the
# Employees
r = c.fetchall()
... |
#Output : pip install mysqlconnector | Employee Management System using Python
# Function to Display All Employees
# from Employee Table
def Display_Employees():
# query to select all rows from
# Employee Table
sql = "select * from empd"
c = con.cursor()
# Executing the SQL Query
c.execute(sql)
# Fetching all details of all t... |
Employee Management System using Python | https://www.geeksforgeeks.org/employee-management-system-using-python/ | # menu function to display the menu
def menu():
print("Welcome to Employee Management Record")
print("Press ")
print("1 to Add Employee")
print("2 to Remove Employee ")
print("3 to Promote Employee")
print("4 to Display Employees")
print("5 to Exit")
# Taking choice from user
ch = i... |
#Output : pip install mysqlconnector | Employee Management System using Python
# menu function to display the menu
def menu():
print("Welcome to Employee Management Record")
print("Press ")
print("1 to Add Employee")
print("2 to Remove Employee ")
print("3 to Promote Employee")
print("4 to Display Employees")
print("5 to Exit")
... |
Employee Management System using Python | https://www.geeksforgeeks.org/employee-management-system-using-python/ | # importing mysql connector
import mysql.connector
# making Connection
con = mysql.connector.connect(
host="localhost", user="root", password="password", database="emp"
)
# Function to mAdd_Employee
def Add_Employ():
Id = input("Enter Employee Id : ")
# Checking if Employee with given Id
# Already E... |
#Output : pip install mysqlconnector | Employee Management System using Python
# importing mysql connector
import mysql.connector
# making Connection
con = mysql.connector.connect(
host="localhost", user="root", password="password", database="emp"
)
# Function to mAdd_Employee
def Add_Employ():
Id = input("Enter Employee Id : ")
# Checking i... |
Instagram Bot using Python and InstaPy | https://www.geeksforgeeks.org/instagram-bot-using-python-and-instapy/ | from instapy import InstaPy
session = InstaPy(username="your username", password="your password")
session.login() |
#Output : pip install instapy==0.6.8 | Instagram Bot using Python and InstaPy
from instapy import InstaPy
session = InstaPy(username="your username", password="your password")
session.login()
#Output : pip install instapy==0.6.8
[END] |
Instagram Bot using Python and InstaPy | https://www.geeksforgeeks.org/instagram-bot-using-python-and-instapy/ | session.like_by_tags(["dance", "mercedes"], amount=10, interact=True) |
#Output : pip install instapy==0.6.8 | Instagram Bot using Python and InstaPy
session.like_by_tags(["dance", "mercedes"], amount=10, interact=True)
#Output : pip install instapy==0.6.8
[END] |
Instagram Bot using Python and InstaPy | https://www.geeksforgeeks.org/instagram-bot-using-python-and-instapy/ | session.set_dont_like(["naked", "murder", "nsfw"]) |
#Output : pip install instapy==0.6.8 | Instagram Bot using Python and InstaPy
session.set_dont_like(["naked", "murder", "nsfw"])
#Output : pip install instapy==0.6.8
[END] |
Instagram Bot using Python and InstaPy | https://www.geeksforgeeks.org/instagram-bot-using-python-and-instapy/ | session.set_do_comment(True, percentage=100)
session.set_comments(["Nice", "Amazing", "Super"]) |
#Output : pip install instapy==0.6.8 | Instagram Bot using Python and InstaPy
session.set_do_comment(True, percentage=100)
session.set_comments(["Nice", "Amazing", "Super"])
#Output : pip install instapy==0.6.8
[END] |
Instagram Bot using Python and InstaPy | https://www.geeksforgeeks.org/instagram-bot-using-python-and-instapy/ | session.set_do_follow(enabled=True, percentage=100) |
#Output : pip install instapy==0.6.8 | Instagram Bot using Python and InstaPy
session.set_do_follow(enabled=True, percentage=100)
#Output : pip install instapy==0.6.8
[END] |
Instagram Bot using Python and InstaPy | https://www.geeksforgeeks.org/instagram-bot-using-python-and-instapy/ | session.set_user_interact(amount=1, randomize=True, percentage=100) |
#Output : pip install instapy==0.6.8 | Instagram Bot using Python and InstaPy
session.set_user_interact(amount=1, randomize=True, percentage=100)
#Output : pip install instapy==0.6.8
[END] |
Instagram Bot using Python and InstaPy | https://www.geeksforgeeks.org/instagram-bot-using-python-and-instapy/ | session.end() |
#Output : pip install instapy==0.6.8 | Instagram Bot using Python and InstaPy
session.end()
#Output : pip install instapy==0.6.8
[END] |
File Sharing App using Python | https://www.geeksforgeeks.org/file-sharing-app-using-python/ | # import necessary modules
# for implementing the HTTP Web servers
import http.server
# provides access to the BSD socket interface
import socket
# a framework for network servers
import socketserver
# to display a Web-based documents to users
import webbrowser
# to generate qrcode
import pyqrcode
from pyqrcode im... |
#Output : pip install pyqrcode | File Sharing App using Python
# import necessary modules
# for implementing the HTTP Web servers
import http.server
# provides access to the BSD socket interface
import socket
# a framework for network servers
import socketserver
# to display a Web-based documents to users
import webbrowser
# to generate qrcode
im... |
Send message to Telementsegram user using Python | https://www.geeksforgeeks.org/send-message-to-telegram-user-using-python/ | # importing all required libraries
import telebot
from telethon.sync import TelegramClient
from telethon.tl.types import InputPeerUser, InputPeerChannel
from telethon import TelegramClient, sync, events
# get your api_id, api_hash, token
# from telegram as described above
api_id = "API_id"
api_hash = "API_hash"
token... |
#Output : pip install telebot | Send message to Telementsegram user using Python
# importing all required libraries
import telebot
from telethon.sync import TelegramClient
from telethon.tl.types import InputPeerUser, InputPeerChannel
from telethon import TelegramClient, sync, events
# get your api_id, api_hash, token
# from telegram as described ab... |
Whatsapp birthday bot | https://www.geeksforgeeks.org/python-whatsapp-birthday-bot/ | # get current date in required format
import datetime
# store the birthdates of your contacts
import json
from selenium import webdriver
# add a delay so that all elements of
# the webpage are loaded before proceeding
import time
# Global variable Do not use elsewhere
eleNM = None
# This function is just to retur... |
#Output : pip install selenium | Whatsapp birthday bot
# get current date in required format
import datetime
# store the birthdates of your contacts
import json
from selenium import webdriver
# add a delay so that all elements of
# the webpage are loaded before proceeding
import time
# Global variable Do not use elsewhere
eleNM = None
# This fun... |
Corona HelementspBot | https://www.geeksforgeeks.org/corona-helpbot/ | import nltk
import numpy
import tflearn
import tensorflow
import pickle
import random
import json
nltk.download("punkt")
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
# loading the json data
with open("WHO.json") as file:
data = json.load(file)
# print(data["intents"])
try:
... |
#Output : Python 3 | Corona HelementspBot
import nltk
import numpy
import tflearn
import tensorflow
import pickle
import random
import json
nltk.download("punkt")
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
# loading the json data
with open("WHO.json") as file:
data = json.load(file)
# print(data[... |
Amazon product availability checker using Python | https://www.geeksforgeeks.org/amazon-product-availability-checker-using-python/ | # Python script for Amazon product availability checker
# importing libraries
from lxml import html
import requests
from time import sleep
import time
import schedule
import smtplib
# Email id for who want to check availability
receiver_email_id = "EMAIL_ID_OF_USER"
def check(url):
headers = {
"User-Agen... |
#Output : Tracking.... | Amazon product availability checker using Python
# Python script for Amazon product availability checker
# importing libraries
from lxml import html
import requests
from time import sleep
import time
import schedule
import smtplib
# Email id for who want to check availability
receiver_email_id = "EMAIL_ID_OF_USER"
d... |
Hotelements Management System | https://www.geeksforgeeks.org/hotel-management-system/ | // C++ program to solve// the given question??????#include <algorithm>#include <iostream>#include <string>#include <vector>??????using namespace std;??????// Create class for hotel data.class Hotel {public:????????????????????????string name;????????????????????????int roomAvl;????????????????????????string location;??... |
#Output : Hotel Name Room Available Location Rating Price per Room | Hotelements Management System
// C++ program to solve// the given question??????#include <algorithm>#include <iostream>#include <string>#include <vector>??????using namespace std;??????// Create class for hotel data.class Hotel {public:????????????????????????string name;????????????????????????int roomAvl;????????????... |
Hotelements Management System | https://www.geeksforgeeks.org/hotel-management-system/ | # Python program to solve
# the given question
# Create class for hotel data.
class Hotel:
sortParam = "name"
def __init__(self) -> None:
self.name = ""
self.roomAvl = 0
self.location = ""
self.rating = int
self.pricePr = 0
def __lt__(self, other):
getattr... |
#Output : Hotel Name Room Available Location Rating Price per Room | Hotelements Management System
# Python program to solve
# the given question
# Create class for hotel data.
class Hotel:
sortParam = "name"
def __init__(self) -> None:
self.name = ""
self.roomAvl = 0
self.location = ""
self.rating = int
self.pricePr = 0
def __lt__... |
Hotelements Management System | https://www.geeksforgeeks.org/hotel-management-system/ | // javascript program to solve// the given question??????// Create class for hotel data.class Hotel {??????????????????????????????????????????????????????co"";????????????????????????????????????????????????this.roomAvl = 0;"";????????????????????????????????????????????????this.rating = 0;????????????????????????????... |
#Output : Hotel Name Room Available Location Rating Price per Room | Hotelements Management System
// javascript program to solve// the given question??????// Create class for hotel data.class Hotel {??????????????????????????????????????????????????????co"";????????????????????????????????????????????????this.roomAvl = 0;"";????????????????????????????????????????????????this.rating = ... |
Build a COVID19 Vaccine Tracker Using Python | https://www.geeksforgeeks.org/build-a-covid19-vaccine-tracker-using-python/ | import requests
from bs4 import BeautifulSoup |
#Output : pip install bs4 | Build a COVID19 Vaccine Tracker Using Python
import requests
from bs4 import BeautifulSoup
#Output : pip install bs4
[END] |
Build a COVID19 Vaccine Tracker Using Python | https://www.geeksforgeeks.org/build-a-covid19-vaccine-tracker-using-python/ | def getdata(url):
r = requests.get(url)
return r.text |
#Output : pip install bs4 | Build a COVID19 Vaccine Tracker Using Python
def getdata(url):
r = requests.get(url)
return r.text
#Output : pip install bs4
[END] |
Build a COVID19 Vaccine Tracker Using Python | https://www.geeksforgeeks.org/build-a-covid19-vaccine-tracker-using-python/ | htmldata = getdata("https://covid-19tracker.milkeninstitute.org/")
soup = BeautifulSoup(htmldata, "html.parser")
res = soup.find_all("div", class_="is_h5-2 is_developer w-richtext")
print(str(res)) |
#Output : pip install bs4 | Build a COVID19 Vaccine Tracker Using Python
htmldata = getdata("https://covid-19tracker.milkeninstitute.org/")
soup = BeautifulSoup(htmldata, "html.parser")
res = soup.find_all("div", class_="is_h5-2 is_developer w-richtext")
print(str(res))
#Output : pip install bs4
[END] |
Build a COVID19 Vaccine Tracker Using Python | https://www.geeksforgeeks.org/build-a-covid19-vaccine-tracker-using-python/ | import requests
from bs4 import BeautifulSoup
def getdata(url):
r = requests.get(url)
return r.text
htmldata = getdata("https://covid-19tracker.milkeninstitute.org/")
soup = BeautifulSoup(htmldata, "html.parser")
result = str(soup.find_all("div", class_="is_h5-2 is_developer w-richtext"))
print("NO 1 " + r... |
#Output : pip install bs4 | Build a COVID19 Vaccine Tracker Using Python
import requests
from bs4 import BeautifulSoup
def getdata(url):
r = requests.get(url)
return r.text
htmldata = getdata("https://covid-19tracker.milkeninstitute.org/")
soup = BeautifulSoup(htmldata, "html.parser")
result = str(soup.find_all("div", class_="is_h5-2 ... |
Email Id Extractor Project from sites in Scrapy Python | https://www.geeksforgeeks.org/email-id-extractor-project-from-sites-in-scrapy-python/ | # web scraping framework
import scrapy
# for regular expression
import re
# for selenium request
from scrapy_selenium import SeleniumRequest
# for link extraction
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor |
#Output : pip install scrapy | Email Id Extractor Project from sites in Scrapy Python
# web scraping framework
import scrapy
# for regular expression
import re
# for selenium request
from scrapy_selenium import SeleniumRequest
# for link extraction
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
#Output : pip install scrapy
[END... |
Email Id Extractor Project from sites in Scrapy Python | https://www.geeksforgeeks.org/email-id-extractor-project-from-sites-in-scrapy-python/ | def start_requests(self):
yield SeleniumRequest(
url="https://www.geeksforgeeks.org/",
wait_time=3,
screenshot=True,
callback=self.parse,
dont_filter=True,
) |
#Output : pip install scrapy | Email Id Extractor Project from sites in Scrapy Python
def start_requests(self):
yield SeleniumRequest(
url="https://www.geeksforgeeks.org/",
wait_time=3,
screenshot=True,
callback=self.parse,
dont_filter=True,
)
#Output : pip install scrapy
[END] |
Email Id Extractor Project from sites in Scrapy Python | https://www.geeksforgeeks.org/email-id-extractor-project-from-sites-in-scrapy-python/ | def parse(self, response):
# this helps to get all links from source code
links = LxmlLinkExtractor(allow=()).extract_links(response)
# Finallinks contains links url
Finallinks = [str(link.url) for link in links]
# links list for url that may have email ids
links = []
# filtering and stor... |
#Output : pip install scrapy | Email Id Extractor Project from sites in Scrapy Python
def parse(self, response):
# this helps to get all links from source code
links = LxmlLinkExtractor(allow=()).extract_links(response)
# Finallinks contains links url
Finallinks = [str(link.url) for link in links]
# links list for url that may ... |
Email Id Extractor Project from sites in Scrapy Python | https://www.geeksforgeeks.org/email-id-extractor-project-from-sites-in-scrapy-python/ | def parse_link(self, response):
# response.meta['links'] this helps to get links list
links = response.meta["links"]
flag = 0
# links that contains following bad words are discarded
bad_words = ["facebook", "instagram", "youtube", "twitter", "wiki", "linkedin"]
for word in bad_words:
#... |
#Output : pip install scrapy | Email Id Extractor Project from sites in Scrapy Python
def parse_link(self, response):
# response.meta['links'] this helps to get links list
links = response.meta["links"]
flag = 0
# links that contains following bad words are discarded
bad_words = ["facebook", "instagram", "youtube", "twitter", "w... |
Email Id Extractor Project from sites in Scrapy Python | https://www.geeksforgeeks.org/email-id-extractor-project-from-sites-in-scrapy-python/ | def parsed(self, response):
# emails list of uniqueemail set
emails = list(self.uniqueemail)
finalemail = []
for email in emails:
# avoid garbage value by using '.in' and '.com'
# and append email ids to finalemail
if ".in" in email or ".com" in email or "info" in email or "org"... |
#Output : pip install scrapy | Email Id Extractor Project from sites in Scrapy Python
def parsed(self, response):
# emails list of uniqueemail set
emails = list(self.uniqueemail)
finalemail = []
for email in emails:
# avoid garbage value by using '.in' and '.com'
# and append email ids to finalemail
if ".in" ... |
Email Id Extractor Project from sites in Scrapy Python | https://www.geeksforgeeks.org/email-id-extractor-project-from-sites-in-scrapy-python/ | # web scraping framework
import scrapy
# for regular expression
import re
# for selenium request
from scrapy_selenium import SeleniumRequest
# for link extraction
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
class EmailtrackSpider(scrapy.Spider):
# name of spider
name = "emailtrack"
# ... |
#Output : pip install scrapy | Email Id Extractor Project from sites in Scrapy Python
# web scraping framework
import scrapy
# for regular expression
import re
# for selenium request
from scrapy_selenium import SeleniumRequest
# for link extraction
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
class EmailtrackSpider(scrapy.Spider... |
How to scrape data from google maps using Python? | https://www.geeksforgeeks.org/how-to-scrape-data-from-google-maps-using-python/ | # Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser = webdriver.Chrome(
executable_path="C:\chromed... |
#Output : 1 - Papa Johns Pizza
| How to scrape data from google maps using Python?
# Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser =... |
How to scrape data from google maps using Python? | https://www.geeksforgeeks.org/how-to-scrape-data-from-google-maps-using-python/ | # Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser = webdriver.Chrome(
executable_path="C:\chromed... |
#Output : 1 - Papa Johns Pizza
| How to scrape data from google maps using Python?
# Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser =... |
How to scrape data from google maps using Python? | https://www.geeksforgeeks.org/how-to-scrape-data-from-google-maps-using-python/ | # Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser = webdriver.Chrome(
executable_path="C:\chromed... |
#Output : 1 - Papa Johns Pizza
| How to scrape data from google maps using Python?
# Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser =... |
How to scrape data from google maps using Python? | https://www.geeksforgeeks.org/how-to-scrape-data-from-google-maps-using-python/ | # Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser = webdriver.Chrome(
executable_path="C:\chromed... |
#Output : 1 - Papa Johns Pizza
| How to scrape data from google maps using Python?
# Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser =... |
How to scrape data from google maps using Python? | https://www.geeksforgeeks.org/how-to-scrape-data-from-google-maps-using-python/ | # Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser = webdriver.Chrome(
executable_path="C:\chromed... |
#Output : 1 - Papa Johns Pizza
| How to scrape data from google maps using Python?
# Import the library Selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# Make browser open in background
options = webdriver.ChromeOptions()
options.add_argument("headless")
# Create the webdriver object
browser =... |
Scraping weather data using Python to get umbrelementsla reminder on email | https://www.geeksforgeeks.org/scraping-weather-data-using-python-to-get-umbrella-reminder-on-email/ | import schedule
import smtplib
import requests
from bs4 import BeautifulSoup |
#Output : pip install bs4 | Scraping weather data using Python to get umbrelementsla reminder on email
import schedule
import smtplib
import requests
from bs4 import BeautifulSoup
#Output : pip install bs4
[END] |
Scraping weather data using Python to get umbrelementsla reminder on email | https://www.geeksforgeeks.org/scraping-weather-data-using-python-to-get-umbrella-reminder-on-email/ | city = "Hyderabad"
url = "https://www.google.com/search?q=" + "weather" + city
html = requests.get(url).content |
#Output : pip install bs4 | Scraping weather data using Python to get umbrelementsla reminder on email
city = "Hyderabad"
url = "https://www.google.com/search?q=" + "weather" + city
html = requests.get(url).content
#Output : pip install bs4
[END] |
Scraping weather data using Python to get umbrelementsla reminder on email | https://www.geeksforgeeks.org/scraping-weather-data-using-python-to-get-umbrella-reminder-on-email/ | soup = BeautifulSoup(html, "html.parser")
temperature = soup.find("div", attrs={"class": "BNeawe iBp4i AP7Wnd"}).text
time_sky = soup.find("div", attrs={"class": "BNeawe tAd8D AP7Wnd"}).text
# formatting data
sky = time_sky.split("\n")[1] |
#Output : pip install bs4 | Scraping weather data using Python to get umbrelementsla reminder on email
soup = BeautifulSoup(html, "html.parser")
temperature = soup.find("div", attrs={"class": "BNeawe iBp4i AP7Wnd"}).text
time_sky = soup.find("div", attrs={"class": "BNeawe tAd8D AP7Wnd"}).text
# formatting data
sky = time_sky.split("\n")[1]
#Out... |
Scraping weather data using Python to get umbrelementsla reminder on email | https://www.geeksforgeeks.org/scraping-weather-data-using-python-to-get-umbrella-reminder-on-email/ | if (
sky == "Rainy"
or sky == "Rain And Snow"
or sky == "Showers"
or sky == "Haze"
or sky == "Cloudy"
):
smtp_object = smtplib.SMTP("smtp.gmail.com", 587) |
#Output : pip install bs4 | Scraping weather data using Python to get umbrelementsla reminder on email
if (
sky == "Rainy"
or sky == "Rain And Snow"
or sky == "Showers"
or sky == "Haze"
or sky == "Cloudy"
):
smtp_object = smtplib.SMTP("smtp.gmail.com", 587)
#Output : pip install bs4
[END] |
Scraping weather data using Python to get umbrelementsla reminder on email | https://www.geeksforgeeks.org/scraping-weather-data-using-python-to-get-umbrella-reminder-on-email/ | # start TLS for security
smtp_object.starttls()
# Authentication
smtp_object.login("YOUR EMAIL", "PASSWORD")
subject = "Umbrella Reminder"
body = (
f"Take an umbrella before leaving the house.\
Weather condition for today is ",
{sky},
" and temperature is {temperature} in {city}.",
)
msg = f"Subject:{subjec... |
#Output : pip install bs4 | Scraping weather data using Python to get umbrelementsla reminder on email
# start TLS for security
smtp_object.starttls()
# Authentication
smtp_object.login("YOUR EMAIL", "PASSWORD")
subject = "Umbrella Reminder"
body = (
f"Take an umbrella before leaving the house.\
Weather condition for today is ",
{sky},
... |
Scraping weather data using Python to get umbrelementsla reminder on email | https://www.geeksforgeeks.org/scraping-weather-data-using-python-to-get-umbrella-reminder-on-email/ | # Every day at 06:00AM time umbrellaReminder() is called.
schedule.every().day.at("06:00").do(umbrellaReminder)
while True:
schedule.run_pending() |
#Output : pip install bs4 | Scraping weather data using Python to get umbrelementsla reminder on email
# Every day at 06:00AM time umbrellaReminder() is called.
schedule.every().day.at("06:00").do(umbrellaReminder)
while True:
schedule.run_pending()
#Output : pip install bs4
[END] |
Scraping weather data using Python to get umbrelementsla reminder on email | https://www.geeksforgeeks.org/scraping-weather-data-using-python-to-get-umbrella-reminder-on-email/ | import schedule
import smtplib
import requests
from bs4 import BeautifulSoup
def umbrellaReminder():
city = "Hyderabad"
# creating url and requests instance
url = "https://www.google.com/search?q=" + "weather" + city
html = requests.get(url).content
# getting raw data
soup = BeautifulSoup(ht... |
#Output : pip install bs4 | Scraping weather data using Python to get umbrelementsla reminder on email
import schedule
import smtplib
import requests
from bs4 import BeautifulSoup
def umbrellaReminder():
city = "Hyderabad"
# creating url and requests instance
url = "https://www.google.com/search?q=" + "weather" + city
html = re... |
Scraping Reddit using Python | https://www.geeksforgeeks.org/scraping-reddit-using-python/ | # Read-only instance
reddit_read_only = praw.Reddit(
client_id="", # your client id
client_secret="", # your client secret
user_agent="",
) # your user agent
# Authorized instance
reddit_authorized = praw.Reddit(
client_id="", # your client id
client_secret="", # your client secret
user_ag... |
#Output : pip install praw | Scraping Reddit using Python
# Read-only instance
reddit_read_only = praw.Reddit(
client_id="", # your client id
client_secret="", # your client secret
user_agent="",
) # your user agent
# Authorized instance
reddit_authorized = praw.Reddit(
client_id="", # your client id
client_secret="", # y... |
Scraping Reddit using Python | https://www.geeksforgeeks.org/scraping-reddit-using-python/ | import praw
import pandas as pd
reddit_read_only = praw.Reddit(
client_id="", # your client id
client_secret="", # your client secret
user_agent="",
) # your user agent
subreddit = reddit_read_only.subreddit("redditdev")
# Display the name of the Subreddit
print("Display Name:", subreddit.display_nam... |
#Output : pip install praw | Scraping Reddit using Python
import praw
import pandas as pd
reddit_read_only = praw.Reddit(
client_id="", # your client id
client_secret="", # your client secret
user_agent="",
) # your user agent
subreddit = reddit_read_only.subreddit("redditdev")
# Display the name of the Subreddit
print("Display ... |
Scraping Reddit using Python | https://www.geeksforgeeks.org/scraping-reddit-using-python/ | subreddit = reddit_read_only.subreddit("Python")
for post in subreddit.hot(limit=5):
print(post.title)
print() |
#Output : pip install praw | Scraping Reddit using Python
subreddit = reddit_read_only.subreddit("Python")
for post in subreddit.hot(limit=5):
print(post.title)
print()
#Output : pip install praw
[END] |
Scraping Reddit using Python | https://www.geeksforgeeks.org/scraping-reddit-using-python/ | posts = subreddit.top("month")
# Scraping the top posts of the current month
posts_dict = {
"Title": [],
"Post Text": [],
"ID": [],
"Score": [],
"Total Comments": [],
"Post URL": [],
}
for post in posts:
# Title of each post
posts_dict["Title"].append(post.title)
# Text inside a p... |
#Output : pip install praw | Scraping Reddit using Python
posts = subreddit.top("month")
# Scraping the top posts of the current month
posts_dict = {
"Title": [],
"Post Text": [],
"ID": [],
"Score": [],
"Total Comments": [],
"Post URL": [],
}
for post in posts:
# Title of each post
posts_dict["Title"].append(post.... |
Scraping Reddit using Python | https://www.geeksforgeeks.org/scraping-reddit-using-python/ | import pandas as pd
top_posts.to_csv("Top Posts.csv", index=True) |
#Output : pip install praw | Scraping Reddit using Python
import pandas as pd
top_posts.to_csv("Top Posts.csv", index=True)
#Output : pip install praw
[END] |
Scraping Reddit using Python | https://www.geeksforgeeks.org/scraping-reddit-using-python/ | import praw
import pandas as pd
reddit_read_only = praw.Reddit(
client_id="", # your client id
client_secret="", # your client secret
user_agent="",
) # your user agent
# URL of the post
url = "https://www.reddit.com/r/IAmA/comments/m8n4vt/\
im_bill_gates_cochair_of_the_bill_and_melinda/"
# Creating a... |
#Output : pip install praw | Scraping Reddit using Python
import praw
import pandas as pd
reddit_read_only = praw.Reddit(
client_id="", # your client id
client_secret="", # your client secret
user_agent="",
) # your user agent
# URL of the post
url = "https://www.reddit.com/r/IAmA/comments/m8n4vt/\
im_bill_gates_cochair_of_the_bil... |
Scraping Reddit using Python | https://www.geeksforgeeks.org/scraping-reddit-using-python/ | from praw.models import MoreComments
post_comments = []
for comment in submission.comments:
if type(comment) == MoreComments:
continue
post_comments.append(comment.body)
# creating a dataframe
comments_df = pd.DataFrame(post_comments, columns=["comment"])
comments_df |
#Output : pip install praw | Scraping Reddit using Python
from praw.models import MoreComments
post_comments = []
for comment in submission.comments:
if type(comment) == MoreComments:
continue
post_comments.append(comment.body)
# creating a dataframe
comments_df = pd.DataFrame(post_comments, columns=["comment"])
comments_df
#O... |
How to fetch data from Jira in Python? | https://www.geeksforgeeks.org/how-to-fetch-data-from-jira-in-python/ | # import the installed Jira library
from jira import JIRA
# Specify a server key. It should be your
# domain name link. yourdomainname.atlassian.net
jiraOptions = {"server": "https://txxxxxxpython.atlassian.net"}
# Get a JIRA client instance, pass,
# Authentication parameters
# and the Server name.
# emailID = your e... |
#Output : pip install jira | How to fetch data from Jira in Python?
# import the installed Jira library
from jira import JIRA
# Specify a server key. It should be your
# domain name link. yourdomainname.atlassian.net
jiraOptions = {"server": "https://txxxxxxpython.atlassian.net"}
# Get a JIRA client instance, pass,
# Authentication parameters
# ... |
How to fetch data from Jira in Python? | https://www.geeksforgeeks.org/how-to-fetch-data-from-jira-in-python/ | # import the installed Jira library
from jira import JIRA
# Specify a server key. It is your domain
# name link.
jiraOptions = {"server": "https://txxxxxxpython.atlassian.net"}
# Get a JIRA client instance, Pass
# Authentication parameters
# and Server name.
# emailID = your emailID
# token = token you receive afte... |
#Output : pip install jira | How to fetch data from Jira in Python?
# import the installed Jira library
from jira import JIRA
# Specify a server key. It is your domain
# name link.
jiraOptions = {"server": "https://txxxxxxpython.atlassian.net"}
# Get a JIRA client instance, Pass
# Authentication parameters
# and Server name.
# emailID = your e... |
How to fetch data from Jira in Python? | https://www.geeksforgeeks.org/how-to-fetch-data-from-jira-in-python/ | # Import the required libraries
import requests
from requests.auth import HTTPBasicAuth
import json
import pandas as pd
# URL to Search all issues.
url = "https://txxxxxxpython.atlassian.net/rest/api/2/search"
# Create an authentication object,using
# registered emailID, and, token received.
auth = HTTPBasicAuth("prx... |
#Output : pip install jira | How to fetch data from Jira in Python?
# Import the required libraries
import requests
from requests.auth import HTTPBasicAuth
import json
import pandas as pd
# URL to Search all issues.
url = "https://txxxxxxpython.atlassian.net/rest/api/2/search"
# Create an authentication object,using
# registered emailID, and, to... |
Scrape most reviewed news and tweet using Python | https://www.geeksforgeeks.org/scrape-most-reviewed-news-and-tweet-using-python/ | # Python program to get top 3 trendy news item
import tweepy
import json
from datetime import date, timedelta, datetime
from pymongo import MongoClient
from html.parser import HTMLParser
import re
from pyshorteners import Shortener
NewsArrayIndex = 0
NewsArray = [None] * 3
class MyHTMLParser(HTMLParser):
# Th... |
#Output : pip install tweepy | Scrape most reviewed news and tweet using Python
# Python program to get top 3 trendy news item
import tweepy
import json
from datetime import date, timedelta, datetime
from pymongo import MongoClient
from html.parser import HTMLParser
import re
from pyshorteners import Shortener
NewsArrayIndex = 0
NewsArray = [Non... |
Scrape content from dynamic websites | https://www.geeksforgeeks.org/scrape-content-from-dynamic-websites/ | #### This program scrapes naukri.com's page and gives our result as a
#### list of all the job_profiles which are currently present there.
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# url of the page we want to scrape
url = ... |
#Output :
| Scrape content from dynamic websites
#### This program scrapes naukri.com's page and gives our result as a
#### list of all the job_profiles which are currently present there.
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# url... |
Automate Instagram Messages using Python | https://www.geeksforgeeks.org/automate-instagram-messages-using-python/ | from selenium import webdriver
import os
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager |
#Output : pip install selenium | Automate Instagram Messages using Python
from selenium import webdriver
import os
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.keys import Keys
from webdriver_mana... |
Automate Instagram Messages using Python | https://www.geeksforgeeks.org/automate-instagram-messages-using-python/ | driver = webdriver.Chrome(ChromeDriverManager().install()) |
#Output : pip install selenium | Automate Instagram Messages using Python
driver = webdriver.Chrome(ChromeDriverManager().install())
#Output : pip install selenium
[END] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.