Skip to content

Instantly share code, notes, and snippets.

View nikhilkumarsingh's full-sized avatar
🎯
Focusing

Nikhil Kumar Singh nikhilkumarsingh

🎯
Focusing
View GitHub Profile
@nikhilkumarsingh
nikhilkumarsingh / paint.py
Created November 3, 2017 16:26
A simple paint application using tkinter in Python 3
from tkinter import *
from tkinter.colorchooser import askcolor
class Paint(object):
DEFAULT_PEN_SIZE = 5.0
DEFAULT_COLOR = 'black'
def __init__(self):
import requests
url = input("Enter the URL: ")
r = requests.get(url)
print("{} redirections took place.".format(len(r.history)-1))
print("Following redirections took place:")
import numpy as np
import cv2
# for windows, mac users
# from PIL import ImageGrab
# for linux users
import pyscreenshot as ImageGrab
# four character code object for video writer
fourcc = cv2.VideoWriter_fourcc(*'XVID')
# video writer object
import requests
url = "http://suggestqueries.google.com/complete/search"
params = {
"client": "firefox",
"q": "ind",
"hl": "en"
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikhilkumarsingh
nikhilkumarsingh / select_files.py
Created May 3, 2018 14:26
Example to select files using File Explorer Dialog Box in Python
from PyQt5.QtWidgets import QFileDialog, QApplication
from PyQt5 import QtWidgets
def select_files(directory_location=None):
qtapp = QApplication([directory_location])
qtwgt = QtWidgets.QWidget()
filenames, _ = QFileDialog.getOpenFileNames(qtwgt)
return filenames
@nikhilkumarsingh
nikhilkumarsingh / select_file_tk.py
Created May 3, 2018 15:43
select files using Tkinter
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename()
print(file_path)
@nikhilkumarsingh
nikhilkumarsingh / copy.ipynb
Last active May 13, 2018 06:21
copy in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.