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
import requests
import json
from tkinter import *
from tkinter.messagebox import showinfo, showerror
def send_sms(number, message):
url = 'https://www.fast2sms.com/dev/bulk'
params = {
'authorization': 'YOUR_APT_KEY',
from flask import Flask,request, url_for, redirect, render_template ## importing necessary libraries
import pickle ## pickle for loading model(Diabetes.pkl)
import pandas as pd ## to convert the input data into a dataframe for giving as a input to the model
app = Flask(__name__) ## setting up flask name
model = pickle.load(open("Diabetes.pkl", "rb")) ##loading model
@app.route('/') ## Defining main index route
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 weather(city):
city=city.replace(" ","+")
res = requests.get(f'https://www.google.com/search?q={city}&oq={city}&aqs=chrome.0.35i39l2j0l4j46j69i60.6128j1j7&sourceid=chrome&ie=UTF-8',headers=headers)
print("Searching in google......\n")
soup = BeautifulSoup(res.text,'html.parser')
location = soup.select('#wob_loc')[0].getText().strip()
keys=[]
def on_press(key):
global keys
#keys.append(str(key).replace("'",""))
string = str(key).replace("'","")
keys.append(string)
main_string = "".join(keys)
from flask import Flask,request, url_for, redirect, render_template
import requests
from bs4 import BeautifulSoup
import pprint
import smtplib
from email.message import EmailMessage
import csv ### For storing all the information of name,price,desired price,links and email in a csv file
import schedule
import time
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
"""
String : Python
reversed string : nohtyp
python
[p,y,t,h,o,n]
""+n = n
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
OPERATORS = set(['+', '-', '*', '/', '(', ')', '^']) # set of operators
PRIORITY = {'+':1, '-':1, '*':2, '/':2, '^':3} # dictionary having priorities
def infix_to_postfix(expression): #input expression
stack = [] # initially stack empty
output = '' # initially output empty
for ch in expression:
if ch not in OPERATORS: # if an operand then put it directly in postfix expression
output+= ch
elif ch == '(' : # else operators should be put in stack
class Stack():
def __init__(self):
self.items = []
def push(self,item):
self.items.append(item)
def pop(self):
return self.items.pop()
def is_empty(self):
return self.items==[]
def peek(self):