Skip to content

Instantly share code, notes, and snippets.

View Abhayparashar31's full-sized avatar
:octocat:
Learning New Things

Abhay Parashar Abhayparashar31

:octocat:
Learning New Things
View GitHub Profile
class Stack():
def __init__(self):
self.items = [] ## Empty list intilize
def push(self,item):
self.items.append(item) ## simple appending to list
def pop(self):
return self.items.pop() ## Removing top element of the stack
# Naive Bayes
# Importing the libraries
import numpy as np ## scientific comutaion
import matplotlib.pyplot as plt ## Visulization
import pandas as pd ## Reading data
# Importing the dataset
dataset = pd.read_csv('https://raw.githubusercontent.com/shivang98/Social-Network-ads-Boost/master/Social_Network_Ads.csv') ## Reading data from the url
X = dataset.iloc[:, [2, 3]].values ##
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
## importing dataframe
df = pd.read_csv("https://gist.githubusercontent.com/nstokoe/7d4717e96c21b8ad04ec91f361b000cb/raw/bf95a2e30fceb9f2ae990eac8379fc7d844a0196/weight-height.csv")
X=df['Height'].values[:,None]
y=df.iloc[:,2].values
import pandas as pd
import datetime
import smtplib
from email.message import EmailMessage
import os
def sendEmail(to, sub, msg):
print(f"email to {to} \nsend with subject: {sub}\n message: {msg}")
email = EmailMessage()
email['from'] = 'Abhay Parashar'
import requests
import json
from tkinter import *
from tkinter.messagebox import showinfo, showerror
def send_sms(number, message):
## if you are using some other sms bulk service just paste the whole python code here and the place where number and message is inset replace it with number and message.
url = 'https://www.fast2sms.com/dev/bulk'
params = {
from bs4 import BeautifulSoup
import requests
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}
def google(query):
query = query.replace(" ","+")
try:
url = f'https://www.google.com/search?q={query}&oq={query}&aqs=chrome..69i57j46j69i59j35i39j0j46j0l2.4948j0j7&sourceid=chrome&ie=UTF-8'
res = requests.get(url,headers=headers)
soup = BeautifulSoup(res.text,'html.parser')
from tkinter import *
def input1(event):
text = event.widget.cget("text")
# print(text)
if text == "=": ## WHen = is pressed evaluate all the operations
try:
# evaluating the result for str
from pytube import YouTube
from tkinter.filedialog import *
from tkinter.messagebox import *
from tkinter import *
from threading import *
font = ('verdana', 20)
file_size = 0
# oncomplete callback function
def completeDownload(stream=None, file_path=None):
from tkinter import *
from tkinter import ttk
from googletrans import Translator , LANGUAGES
root = Tk()
root.iconbitmap("profile.ico")
root.geometry('1080x350')
root.resizable(0,0)
root.title("Karl Language Translator")
root.config(bg = 'ghost white')
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
from bs4 import BeautifulSoup
import requests
import csv
name = input("Job name:\n").replace(" ","-")