Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 8dae244

Browse files
author
Zaytsev Dmitriy
committed
removed unused imports
1 parent 6f67e2f commit 8dae244

File tree

25 files changed

+12
-29
lines changed

25 files changed

+12
-29
lines changed

projects/Convert_JPEG_to_PNG/converter_GUI.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import tkinter as tk
2-
from tkinter import filedialog, messagebox
2+
from tkinter import filedialog
33
from PIL import Image
44
root = tk.Tk() # Tkinter window initialized
55
root.title('Converter') # Title of the window

projects/Convert_numbers_to_word/converter.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import math
21

32
one_digit_words = {
43
'0': ["zero"],
@@ -80,5 +79,5 @@ def converter(n):
8079
break
8180
int(n)
8281
print(n, "-->", converter(n))
83-
except ValueError as e:
82+
except ValueError:
8483
print("Error: Invalid Number!")

projects/Create_a_simple_stopwatch/stopwatch.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import tkinter as Tkinter
22
from datetime import datetime
3-
import time
43
counter = 0
54
running = False
65

projects/Dns_record/dns_record.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#Simple program to fetch dns record of a given website
22

3-
import json
43
import dns.resolver
54

65
#Dictionary to store the dns record of a website

projects/Fetch HTTP status code/fetch_http_status_code.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Program to fetch the http status code give the url/api
2-
from urllib.request import Request, urlopen
2+
from urllib.request import urlopen
33
from urllib.error import URLError, HTTPError
44
import emoji
55

-43.8 KB
Loading
-53.6 KB
Loading
-9.76 KB
Loading
-7.9 KB
Loading
-22 KB
Loading
-13.5 KB
Loading
-14.7 KB
Loading
-7.42 KB
Loading

projects/Fetch_current_weather/fetch_current_weather.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Python program to find current weather details of any city using openweathermap api
2-
import requests, json
2+
import requests
33

44
# Enter your API key here
55
api_key = "Your_API_Key"

projects/Find_imdb_rating/find_IMDb_rating.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from bs4 import BeautifulSoup
22
import requests
3-
import json
43
import pandas as pd
54
import os
65

projects/Get_meta_information_of_images/gps_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import exifread
2-
import requests,json
2+
import requests
33
from geopy.geocoders import Nominatim
44

55
def format_lati_long(data):

projects/Image_watermark/watermark.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def watermark_photo(input_image_path, output_image_path, watermark_image_path):
1010
# add watermark to your image
1111
position = base_image.size
1212

13-
watermark_size = watermark.size
13+
watermark.size
1414

1515
newsize = int(position[0] * 8 / 100), int(position[0] * 8 / 100)
1616

projects/Instagram_profile/profilepic.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from datetime import datetime
21
from tqdm import tqdm
32
import requests
43
import re
5-
import sys
64
from PIL import Image
75

86

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import os
21
import glob
32
import pandas as pd
43

54
extension = 'csv'
65
all_filenames = [i for i in glob.glob('*.{}'.format(extension))]
76

87
combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ])
9-
combined_csv.to_csv( "combined_csv.csv", index=False, encoding='utf-8-sig')
8+
combined_csv.to_csv( "combined_csv.csv", index=False, encoding='utf-8-sig')

projects/Scrape_Hacker_News/main.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import requests
22
import os
3-
from multiprocessing import Pool, cpu_count
4-
from functools import partial
53
from bs4 import BeautifulSoup, SoupStrainer
64
# Makes Output Directory if it does not exist
75
if not os.path.exists(os.path.join(os.getcwd(), 'HackerNews')):
@@ -96,6 +94,6 @@ def fetch(page_no, verbose=False):
9694
for page_no in range(1, pages + 1):
9795
fetch(page_no, verbose)
9896
break
99-
except ValueError as e:
97+
except ValueError:
10098
print('\nInvalid input, probably not a positive integer\n')
10199
continue

projects/Textfile_analysis/textfile_analysis.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import sys
44
import collections
55
import string
6-
import re
76

87
script_name = sys.argv[0]
98

projects/Unstructured Supplemenrary Service Data/ussdtim.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import random
21
import time
32
import sys
43

projects/Web_page_summation/app.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#!/usr/bin/python
2-
from tempfile import NamedTemporaryFile
32
from utils.summarize import summarize
43
import csv
5-
import json
64
import shutil
75
import os
86
import textwrap
97
import logging
10-
import signal
118
import argparse
129
import sys
13-
import getopt
1410

1511

1612
def parse_args(argv):
@@ -127,7 +123,7 @@ def main(argv=sys.argv):
127123
if action == 'simple':
128124
# guide against errors
129125
try:
130-
summary = summarize(url, LANGUAGE, SENTENCES_COUNT)
126+
summarize(url, LANGUAGE, SENTENCES_COUNT)
131127
except:
132128
print(
133129
'\n\n Invalid Entry!, please Ensure you enter a valid web link \n\n')

projects/Write_a_script_to_download_a_random_image_from_unsplash_and_set_it_as_wallpaper/background_windows.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from requests import get
22
import os
33
import ctypes
4-
import argparse
54
import sys
65

76
url = "https://source.unsplash.com/random"

projects/convert_png_images_to_ico_format/convertUI.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import tkinter as tk
2-
from tkinter import filedialog, messagebox
32
from PIL import Image
43

54
# Initialize Tkinter window
@@ -15,7 +14,7 @@
1514
def getPNG():
1615
'''Function to get png image location and open it with pillow'''
1716
global img
18-
import_file_path = filedialog.askopenfilename(filetypes=[("PNG File",'.png')])
17+
import_file_path = tk.filedialog.askopenfilename(filetypes=[("PNG File",'.png')])
1918
img = Image.open(import_file_path)
2019

2120
def convertToICO():
@@ -24,7 +23,7 @@ def convertToICO():
2423
if img is None:
2524
tk.messagebox.showerror("Error", "No File selected")
2625
else:
27-
export_file_path = filedialog.asksaveasfilename(defaultextension='.ico')
26+
export_file_path = tk.filedialog.asksaveasfilename(defaultextension='.ico')
2827
img.save(export_file_path)
2928
tk.messagebox.showinfo("Success", "File converted and saved")
3029

@@ -42,4 +41,4 @@ def convertToICO():
4241
# Convert button to convert selected image and save
4342
saveAsButton = tk.Button(text='Convert PNG to ICO', command=convertToICO, bg=bg, fg=fg, font=font, width=width)
4443
canvas1.create_window(250, 200, window=saveAsButton)
45-
root.mainloop()
44+
root.mainloop()

0 commit comments

Comments
 (0)