diff --git a/projects/Convert_JPEG_to_PNG/converter_GUI.py b/projects/Convert_JPEG_to_PNG/converter_GUI.py index fe4b8fc39..a6d596132 100644 --- a/projects/Convert_JPEG_to_PNG/converter_GUI.py +++ b/projects/Convert_JPEG_to_PNG/converter_GUI.py @@ -1,5 +1,5 @@ import tkinter as tk -from tkinter import filedialog, messagebox +from tkinter import filedialog from PIL import Image root = tk.Tk() # Tkinter window initialized root.title('Converter') # Title of the window diff --git a/projects/Convert_numbers_to_word/converter.py b/projects/Convert_numbers_to_word/converter.py index f9e65c02f..8d2c66a76 100644 --- a/projects/Convert_numbers_to_word/converter.py +++ b/projects/Convert_numbers_to_word/converter.py @@ -1,4 +1,3 @@ -import math one_digit_words = { '0': ["zero"], @@ -80,5 +79,5 @@ def converter(n): break int(n) print(n, "-->", converter(n)) - except ValueError as e: + except ValueError: print("Error: Invalid Number!") \ No newline at end of file diff --git a/projects/Create_a_simple_stopwatch/stopwatch.py b/projects/Create_a_simple_stopwatch/stopwatch.py index b456b192c..47dd4b192 100644 --- a/projects/Create_a_simple_stopwatch/stopwatch.py +++ b/projects/Create_a_simple_stopwatch/stopwatch.py @@ -1,6 +1,5 @@ import tkinter as Tkinter from datetime import datetime -import time counter = 0 running = False diff --git a/projects/Dns_record/dns_record.py b/projects/Dns_record/dns_record.py index 6e01f2b78..70da90b74 100644 --- a/projects/Dns_record/dns_record.py +++ b/projects/Dns_record/dns_record.py @@ -1,6 +1,5 @@ #Simple program to fetch dns record of a given website -import json import dns.resolver #Dictionary to store the dns record of a website diff --git a/projects/Fetch HTTP status code/fetch_http_status_code.py b/projects/Fetch HTTP status code/fetch_http_status_code.py index 99159ba1d..a0da31c17 100644 --- a/projects/Fetch HTTP status code/fetch_http_status_code.py +++ b/projects/Fetch HTTP status code/fetch_http_status_code.py @@ -1,5 +1,5 @@ #Program to fetch the http status code give the url/api -from urllib.request import Request, urlopen +from urllib.request import urlopen from urllib.error import URLError, HTTPError import emoji diff --git a/projects/Fetch_and_store_tweets/img/output-2.PNG b/projects/Fetch_and_store_tweets/img/output-2.PNG index b36e9d02a..f8328b787 100644 Binary files a/projects/Fetch_and_store_tweets/img/output-2.PNG and b/projects/Fetch_and_store_tweets/img/output-2.PNG differ diff --git a/projects/Fetch_and_store_tweets/img/output.PNG b/projects/Fetch_and_store_tweets/img/output.PNG index e903b34ee..682bcf235 100644 Binary files a/projects/Fetch_and_store_tweets/img/output.PNG and b/projects/Fetch_and_store_tweets/img/output.PNG differ diff --git a/projects/Fetch_and_store_tweets/img/step-1.PNG b/projects/Fetch_and_store_tweets/img/step-1.PNG index e33524614..a11cf5597 100644 Binary files a/projects/Fetch_and_store_tweets/img/step-1.PNG and b/projects/Fetch_and_store_tweets/img/step-1.PNG differ diff --git a/projects/Fetch_and_store_tweets/img/step-2.PNG b/projects/Fetch_and_store_tweets/img/step-2.PNG index 4a0c6e459..d902378cd 100644 Binary files a/projects/Fetch_and_store_tweets/img/step-2.PNG and b/projects/Fetch_and_store_tweets/img/step-2.PNG differ diff --git a/projects/Fetch_and_store_tweets/img/step-3.PNG b/projects/Fetch_and_store_tweets/img/step-3.PNG index 98c6f4256..532b31bb6 100644 Binary files a/projects/Fetch_and_store_tweets/img/step-3.PNG and b/projects/Fetch_and_store_tweets/img/step-3.PNG differ diff --git a/projects/Fetch_and_store_tweets/img/step-4.PNG b/projects/Fetch_and_store_tweets/img/step-4.PNG index abfefa38a..31a95d33d 100644 Binary files a/projects/Fetch_and_store_tweets/img/step-4.PNG and b/projects/Fetch_and_store_tweets/img/step-4.PNG differ diff --git a/projects/Fetch_and_store_tweets/img/step-5.PNG b/projects/Fetch_and_store_tweets/img/step-5.PNG index 9d920194d..c4436f9fb 100644 Binary files a/projects/Fetch_and_store_tweets/img/step-5.PNG and b/projects/Fetch_and_store_tweets/img/step-5.PNG differ diff --git a/projects/Fetch_and_store_tweets/img/step-6.PNG b/projects/Fetch_and_store_tweets/img/step-6.PNG index 651af2954..ab5450a38 100644 Binary files a/projects/Fetch_and_store_tweets/img/step-6.PNG and b/projects/Fetch_and_store_tweets/img/step-6.PNG differ diff --git a/projects/Fetch_current_weather/fetch_current_weather.py b/projects/Fetch_current_weather/fetch_current_weather.py index 34fd355e5..606149c96 100644 --- a/projects/Fetch_current_weather/fetch_current_weather.py +++ b/projects/Fetch_current_weather/fetch_current_weather.py @@ -1,5 +1,5 @@ # Python program to find current weather details of any city using openweathermap api -import requests, json +import requests # Enter your API key here api_key = "Your_API_Key" diff --git a/projects/Find_imdb_rating/find_IMDb_rating.py b/projects/Find_imdb_rating/find_IMDb_rating.py index 6e79d8afa..0ebe199d0 100644 --- a/projects/Find_imdb_rating/find_IMDb_rating.py +++ b/projects/Find_imdb_rating/find_IMDb_rating.py @@ -1,6 +1,5 @@ from bs4 import BeautifulSoup import requests -import json import pandas as pd import os diff --git a/projects/Get_meta_information_of_images/gps_utils.py b/projects/Get_meta_information_of_images/gps_utils.py index d89b4964c..3db3ac3d2 100644 --- a/projects/Get_meta_information_of_images/gps_utils.py +++ b/projects/Get_meta_information_of_images/gps_utils.py @@ -1,5 +1,5 @@ import exifread -import requests,json +import requests from geopy.geocoders import Nominatim def format_lati_long(data): diff --git a/projects/Image_watermark/watermark.py b/projects/Image_watermark/watermark.py index d3db68b95..103e9214c 100644 --- a/projects/Image_watermark/watermark.py +++ b/projects/Image_watermark/watermark.py @@ -10,7 +10,7 @@ def watermark_photo(input_image_path, output_image_path, watermark_image_path): # add watermark to your image position = base_image.size - watermark_size = watermark.size + watermark.size newsize = int(position[0] * 8 / 100), int(position[0] * 8 / 100) diff --git a/projects/Instagram_profile/profilepic.py b/projects/Instagram_profile/profilepic.py index 34093a91b..b5061d9b4 100644 --- a/projects/Instagram_profile/profilepic.py +++ b/projects/Instagram_profile/profilepic.py @@ -1,8 +1,6 @@ -from datetime import datetime from tqdm import tqdm import requests import re -import sys from PIL import Image diff --git a/projects/Merge_csv_files/merge_csv_files.py b/projects/Merge_csv_files/merge_csv_files.py index d3d8098bc..6b12e3e0e 100644 --- a/projects/Merge_csv_files/merge_csv_files.py +++ b/projects/Merge_csv_files/merge_csv_files.py @@ -1,4 +1,3 @@ -import os import glob import pandas as pd @@ -6,4 +5,4 @@ all_filenames = [i for i in glob.glob('*.{}'.format(extension))] combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ]) -combined_csv.to_csv( "combined_csv.csv", index=False, encoding='utf-8-sig') \ No newline at end of file +combined_csv.to_csv( "combined_csv.csv", index=False, encoding='utf-8-sig') diff --git a/projects/Scrape_Hacker_News/main.py b/projects/Scrape_Hacker_News/main.py index ee64f7a19..3bcdea575 100644 --- a/projects/Scrape_Hacker_News/main.py +++ b/projects/Scrape_Hacker_News/main.py @@ -1,7 +1,5 @@ import requests import os -from multiprocessing import Pool, cpu_count -from functools import partial from bs4 import BeautifulSoup, SoupStrainer # Makes Output Directory if it does not exist if not os.path.exists(os.path.join(os.getcwd(), 'HackerNews')): @@ -96,6 +94,6 @@ def fetch(page_no, verbose=False): for page_no in range(1, pages + 1): fetch(page_no, verbose) break - except ValueError as e: + except ValueError: print('\nInvalid input, probably not a positive integer\n') continue diff --git a/projects/Textfile_analysis/textfile_analysis.py b/projects/Textfile_analysis/textfile_analysis.py index d606846b3..86d807a65 100644 --- a/projects/Textfile_analysis/textfile_analysis.py +++ b/projects/Textfile_analysis/textfile_analysis.py @@ -3,7 +3,6 @@ import sys import collections import string -import re script_name = sys.argv[0] diff --git a/projects/Unstructured Supplemenrary Service Data/ussdtim.py b/projects/Unstructured Supplemenrary Service Data/ussdtim.py index df9f188f4..84a6fcb3d 100644 --- a/projects/Unstructured Supplemenrary Service Data/ussdtim.py +++ b/projects/Unstructured Supplemenrary Service Data/ussdtim.py @@ -1,4 +1,3 @@ -import random import time import sys diff --git a/projects/Web_page_summation/app.py b/projects/Web_page_summation/app.py index 8f0236eda..96f5cf35c 100644 --- a/projects/Web_page_summation/app.py +++ b/projects/Web_page_summation/app.py @@ -1,16 +1,12 @@ #!/usr/bin/python -from tempfile import NamedTemporaryFile from utils.summarize import summarize import csv -import json import shutil import os import textwrap import logging -import signal import argparse import sys -import getopt def parse_args(argv): @@ -127,7 +123,7 @@ def main(argv=sys.argv): if action == 'simple': # guide against errors try: - summary = summarize(url, LANGUAGE, SENTENCES_COUNT) + summarize(url, LANGUAGE, SENTENCES_COUNT) except: print( '\n\n Invalid Entry!, please Ensure you enter a valid web link \n\n') diff --git a/projects/Write_a_script_to_download_a_random_image_from_unsplash_and_set_it_as_wallpaper/background_windows.py b/projects/Write_a_script_to_download_a_random_image_from_unsplash_and_set_it_as_wallpaper/background_windows.py index 9e694b4f3..5c2e01c74 100644 --- a/projects/Write_a_script_to_download_a_random_image_from_unsplash_and_set_it_as_wallpaper/background_windows.py +++ b/projects/Write_a_script_to_download_a_random_image_from_unsplash_and_set_it_as_wallpaper/background_windows.py @@ -1,7 +1,6 @@ from requests import get import os import ctypes -import argparse import sys url = "https://source.unsplash.com/random" diff --git a/projects/convert_png_images_to_ico_format/convertUI.py b/projects/convert_png_images_to_ico_format/convertUI.py index f4baadfff..19bc792fe 100644 --- a/projects/convert_png_images_to_ico_format/convertUI.py +++ b/projects/convert_png_images_to_ico_format/convertUI.py @@ -1,5 +1,4 @@ import tkinter as tk -from tkinter import filedialog, messagebox from PIL import Image # Initialize Tkinter window @@ -15,7 +14,7 @@ def getPNG(): '''Function to get png image location and open it with pillow''' global img - import_file_path = filedialog.askopenfilename(filetypes=[("PNG File",'.png')]) + import_file_path = tk.filedialog.askopenfilename(filetypes=[("PNG File",'.png')]) img = Image.open(import_file_path) def convertToICO(): @@ -24,7 +23,7 @@ def convertToICO(): if img is None: tk.messagebox.showerror("Error", "No File selected") else: - export_file_path = filedialog.asksaveasfilename(defaultextension='.ico') + export_file_path = tk.filedialog.asksaveasfilename(defaultextension='.ico') img.save(export_file_path) tk.messagebox.showinfo("Success", "File converted and saved") @@ -42,4 +41,4 @@ def convertToICO(): # Convert button to convert selected image and save saveAsButton = tk.Button(text='Convert PNG to ICO', command=convertToICO, bg=bg, fg=fg, font=font, width=width) canvas1.create_window(250, 200, window=saveAsButton) -root.mainloop() \ No newline at end of file +root.mainloop()