Skip to content

Instantly share code, notes, and snippets.

Working from home

Harendra Kumar Kanojiya harendra21

Working from home
View GitHub Profile
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
file_path = filedialog.askopenfilename()
import xlrd
import sys
class ExcelToList():
def __init__(self, file, sheet):
self.file = file
self.sheet = sheet
def convert(self):
# -*- coding: utf-8 -*-
# Using curl to get data from
# Template from pycurl documentation
import pycurl #curl library
import certifi #HTTP over TLS/SSL library
from io import BytesIO #Buffered I/O implementation using an in-memory bytes buffer.
View Combine excel files into
from openpyxl import load_workbook
from openpyxl import Workbook
import os
# Read data from active worksheet and return it as a list
def reader(file):
global path
abs_file = os.path.join(path, file)
wb_sheet = load_workbook(abs_file).active
View Directory
import argparse
import os
def path():
parse = argparse.ArgumentParser(
add_help=True, description="Organize your files to different directories according to their type")
parse.add_argument('directory_path', type=str, default='./',
View Current City
import requests
def get_temperature(json_data):
temp_in_celcius = json_data['main']['temp']
return temp_in_celcius
def get_weather_type(json_data):
weather_type = json_data['weather'][0]['description']
return weather_type
View CSV to
# -*- coding: utf-8 -*-
import openpyxl
import sys
print("This programme writes the data in any Comma-separated value file (such as: .csv or .data) to a Excel file.")
print("The input and output files must be in the same directory of the python file for the programme to work.\n")
from urllib.request import urlopen
from bs4 import BeautifulSoup
quote_page = ''
page = urlopen(quote_page)
soup = BeautifulSoup(page,'html.parser')
for score in soup.find_all('div',attrs={'class':'cb-col cb-col-100 cb-lv-main'}):
import sys
from PIL import Image
from PIL.ExifTags import TAGS
image_file = sys.argv[1]
image_name = image_file.split(".")[0]
image =
except IOError:
View Cryptocurrency
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from colorama import init, Fore, Back, Style
import sys
import os
#get the price