Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Harendra Kumar Kanojiya harendra21

🏠
Working from home
View GitHub Profile
View Bitcoin Price GUI Application.py
import tkinter as tk
from tkinter import ttk
import urllib.request
import json
import time
def get_luno():
# to change ticker pair, look at here https://api.mybitx.com/api/1/tickers
req = urllib.request.urlopen("https://api.mybitx.com/api/1/ticker?pair=XBTMYR")
x = json.loads(req.read().decode("utf-8"))
View Artificial Intelligence Chatbot.py
import sys
try:
import aiml
except ImportError:
print('[!] Failed to import the module')
try:
select = raw_input('[*] Attempt to auto-install aiml? [Y/n')
except KeyboardInterrupt:
print('\n[!] User Cancel')
sys.exit(5)
View Automated Email.py
from smtplib import SMTP as smtp
import json
def sendmail(sender_add, reciever_add, msg, password):
server = smtp('smtp.gmail.com:587')
server.starttls()
server.login(sender_add, password)
server.sendmail(sender_add, reciever_add, msg)
print("Mail sent succesfully....!")
View Location to Address.py
import geocoder
t=input("enter the location:")
g = geocoder.arcgis(t)
print(g.latlng)
View File Encrypt Decrypt.py
import os
import argparse
from cryptography.fernet import Fernet
class Crypt:
def __init__(self):
# can be generated Fernet.generate_key()
View Sudoku Solver.py
def printsudoku(sudoku):
print("\n\n")
for i in range(len(sudoku)):
line = ""
if i == 3 or i == 6:
print("---------------------")
for j in range(len(sudoku[i])):
if j == 3 or j == 6:
line += "| "
line += str(sudoku[i][j])+" "
View calculator.py
# -*- coding: utf-8 -*-
from tkinter import Tk, END, Entry, N, E, S, W, Button
from tkinter import font
from tkinter import Label
from functools import partial
def get_input(entry, argu):
entry.insert(END, argu)
View weather.py
# Python program to find current weather details of any city using openweathermap api
import requests
# Enter your API key here
api_key = "Your_API_Key"
# base_url variable to store url
base_url = "http://api.openweathermap.org/data/2.5/weather?"
# Give city name
View check_connection.py
import csv
import requests
status_dict = {"Website": "Status"}
def main():
with open("websites.txt", "r") as fr:
for line in fr:
website = line.strip()
status = requests.get(website).status_code
status_dict[website] = "working" if status == 200 \
View wikipedia.py
from bs4 import BeautifulSoup
import requests
# Trying to open a random wikipedia article
# Special:Random opens random articles
res = requests.get("https://en.wikipedia.org/wiki/Special:Random")
res.raise_for_status()
# pip install htmlparser
wiki = BeautifulSoup(res.text, "html.parser")