Python Code Samples



Filters


How to do web scrapping from a website for getting keywords
sonia shaik | 5 years, 4 months
from bs4 import BeautifulSoup
from bs4.element import Comment
from urllib.request import Request, 
python web scrapping nltk
get binary code for an integer in python
kishore_kumar | 5 years, 3 months
n = 115

b_n = bin(n)
python binary
Ramya
Python program to print pattern
Ramya | 5 years, 4 months
for i in range (6,1,-1):
	for j in range (i):
		print ("*",end= "")
python pattern
Custom Exception writing in python
kishore_kumar | 5 years, 3 months
class MinLengthError(Exception):
    def __init__(self, message, errors):
        super().__init__
Enter a word: hello hello is valid Enter a word: one Required min length: 4 {'inpt': 'on
python exception
connect to redis and get values using python
kishore_kumar | 4 years, 11 months
import redis # pip install redis
r = redis.Redis(host='localhost', port='6379')

python redis
How to write python dictionary to csv file with header
kishore_kumar | 5 years, 3 months
improt csv

data = [
python csv
Ramya
Word search inside multiple files
Ramya | 5 years, 1 month
import os
search_path = input("Enter directory path to search : ")
file_type = input("File Type : 
python
how to use format function extensively with strings in python
harika | 5 years, 9 months
a = 5
b = 10
c = 15
python
durga
Exception Handling in python
durga | 5 years, 4 months
x=input("enter x: ")
y=input("enter y: ")
try: 
python
get time between dates for each day
kishore_kumar | 1 year, 1 month
from datetime import datetime, timedelta


python datetime
Prev Next