Skip to content

Commit 6ce17d9

Browse files
Merge branch 'master' into master
2 parents 1ff9224 + fd21822 commit 6ce17d9

File tree

16 files changed

+555
-5
lines changed

16 files changed

+555
-5
lines changed

Anime-Tracker/anime_tracker.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ def details(soup):
4444

4545
def entry():
4646
print("\nType complete name>>\n")
47-
anime_name = input(
48-
"[+] Enter the name of the Anime : ").strip().title().replace(
49-
" ", "-")
47+
anime_name = input("Enter the name of the anime : ")
48+
anime_name = (" ".join(anime_name.split())).title().replace(" ", "-")
5049

5150
print("\n")
5251
print(anime_name)

GUI-Password-Generator/generator.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import random
2+
import pyperclip
3+
from tkinter import *
4+
from tkinter.ttk import *
5+
6+
def getStrength():
7+
entry.delete(0, END)
8+
length = var1.get()
9+
lower = "abcdefghijklmnopqrstuvwxyz"
10+
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
11+
digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 !@#$%^&*()"
12+
password = ""
13+
14+
# if strength selected is low
15+
if var.get() == 1:
16+
for i in range(0, length):
17+
password = password + random.choice(lower)
18+
return password
19+
20+
# if strength selected is medium
21+
elif var.get() == 0:
22+
for i in range(0, length):
23+
password = password + random.choice(upper)
24+
return password
25+
26+
# if strength selected is strong
27+
elif var.get() == 3:
28+
for i in range(0, length):
29+
password = password + random.choice(digits)
30+
return password
31+
else:
32+
print("Please choose an option")
33+
34+
35+
# Function for generation of password
36+
def generate():
37+
password1 = getStrength()
38+
entry.insert(10, password1)
39+
40+
41+
# Function for copying password to clipboard
42+
def copy():
43+
random_password = entry.get()
44+
pyperclip.copy(random_password)
45+
46+
47+
# create GUI window
48+
root = Tk()
49+
var = IntVar()
50+
var1 = IntVar()
51+
52+
53+
54+
# Title of the GUI window
55+
root.title("Password Generator")
56+
57+
# create label for length of password
58+
c_label = Label(root, text="Length")
59+
c_label.grid(row=0)
60+
copy_button = Button(root, text="Copy", command=copy)
61+
copy_button.grid(row=0, column=2)
62+
generate_button = Button(root, text="Generate", command=generate)
63+
generate_button.grid(row=0, column=3)
64+
65+
radio_low = Radiobutton(root, text="Low", variable=var, value=1)
66+
radio_low.grid(row=1, column=2, sticky='E')
67+
radio_middle = Radiobutton(root, text="Medium", variable=var, value=0)
68+
radio_middle.grid(row=1, column=3, sticky='E')
69+
radio_strong = Radiobutton(root, text="Strong", variable=var, value=3)
70+
radio_strong.grid(row=1, column=4, sticky='E')
71+
combo = Combobox(root, textvariable=var1)
72+
combo['values'] = (8, 9, 10, 11, 12, 13, 14, 15, 16,
73+
17, 18, 19, 20, 21, 22, 23, 24, 25,
74+
26, 27, 28, 29, 30, 31, 32)
75+
combo.current(0)
76+
combo.bind('<<ComboboxSelected>>')
77+
combo.grid(column=1, row=0)
78+
Random_password = Label(root, text="Generated password",padding=5)
79+
Random_password.grid(row=1)
80+
entry = Entry(root)
81+
entry.grid(row=1, column=1)
82+
83+
84+
##run the GUI continuously
85+
root.mainloop()

GUI-Password-Generator/readme.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Password Generator tool
2+
3+
This is a GUI app that Generates a random password
4+
5+
Features:
6+
Length can be selected
7+
Strength can be selected
8+
Copy to clipboard button
9+
10+
11+
modules needed: pyperclip
12+
>pip install pyperclip
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyperclip==1.8.2

GUI-Stopwatch/readme.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# GUI CALCULATOR
2+
3+
This script user Tkinter to provide a Graphical User Interface.
4+
5+
No Requirements because Tkinter and time is inbuilt
6+
7+
These are customizable
8+
9+
1. The refresh rate (how fast the display updates)
10+
2. Colours: background,button colour
11+
3. Text: font, size, colour
12+
4. The size of the GUI window can be adjusted during execution
13+
5. The default size of the GUI window can be adjusted in the script
14+
6. The button text, position, size

GUI-Stopwatch/stopwatch.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
## tkinter and time modules are inbuilt
2+
from tkinter import *
3+
import time
4+
5+
def run():
6+
global root
7+
root = Tk()
8+
root.title("Stopwatch APP")
9+
width = 400
10+
height = 160
11+
screen_width = root.winfo_screenwidth()
12+
screen_height = root.winfo_screenheight()
13+
x = (screen_width / 2) - (width / 2)
14+
y = (screen_height / 2) - (height / 2)
15+
root.geometry("%dx%d+%d+%d" % (width, height, x, y))
16+
Top = Frame(root)
17+
Top.pack(side=TOP)
18+
stopWatch = StopWatch(root)
19+
stopWatch.pack(side=TOP,pady=15)
20+
Bottom = Frame(root, width=400)
21+
Bottom.pack(side=BOTTOM)
22+
Start = Button(Bottom, text='Start', command=stopWatch.Start, width=20, height=2, bg="green")
23+
Start.pack(side=LEFT)
24+
Stop = Button(Bottom, text='Stop', command=stopWatch.Stop, width=20, height=2, bg="red")
25+
Stop.pack(side=LEFT)
26+
Reset = Button(Bottom, text='Reset', command=stopWatch.Reset, width=15, height=2)
27+
Reset.pack(side=LEFT)
28+
root.config(bg="black")
29+
root.mainloop()
30+
31+
32+
class StopWatch(Frame):
33+
def __init__(self, parent=None, **kw):
34+
'''When object is initialized'''
35+
Frame.__init__(self, parent, kw)
36+
self.startTime = 0.0
37+
self.nextTime = 0.0
38+
self.onRunning = 0
39+
self.timestr = StringVar()
40+
self.MakeWidget()
41+
def Updater(self):
42+
'''update the time shown'''
43+
self.nextTime = time.time() - self.startTime
44+
self.SetTime(self.nextTime)
45+
self.timer = self.after(1, self.Updater)
46+
def MakeWidget(self):
47+
'''make widget for displaying time'''
48+
timeText = Label(self, textvariable=self.timestr, font=("callibri", 50), fg="yellow", bg="grey")
49+
self.SetTime(self.nextTime)
50+
timeText.pack(fill=X, expand=NO, pady=2, padx=2)
51+
def SetTime(self, nextElap):
52+
'''set time that is to be displayed'''
53+
mins = int(nextElap / 60)
54+
secs = int(nextElap - mins * 60.0)
55+
milisecs = int((nextElap - mins * 60.0 - secs) * 100)
56+
self.timestr.set('%02d:%02d:%02d' % (mins, secs, milisecs))
57+
def Start(self):
58+
'''start stopwatch'''
59+
if not self.onRunning:
60+
self.startTime = time.time() - self.nextTime
61+
self.Updater()
62+
self.onRunning = 1
63+
def Stop(self):
64+
'''stop stopwatch'''
65+
if self.onRunning:
66+
self.after_cancel(self.timer)
67+
self.nextTime = time.time() - self.startTime
68+
self.SetTime(self.nextTime)
69+
self.onRunning = 0
70+
def Reset(self):
71+
'''reset stopwatch'''
72+
self.startTime = time.time()
73+
self.nextTime = 0.0
74+
self.SetTime(self.nextTime)
75+
76+
77+
78+
79+
80+
if __name__ == '__main__':
81+
run()

Image Manipulation Script/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# File Downloader Script
2+
3+
4+
The script provided earlier is an "Image Manipulation Script" written in Python using the Pillow library. It allows you to perform basic image manipulations such as resizing, rotating, and flipping an image.
5+
6+
The script consists of three main functions:
7+
8+
-resize_image(): Resizes an input image to a specified size.
9+
-rotate_image(): Rotates an input image by a specified number of degrees.
10+
-flip_image(): Flips an input image based on a specified flip mode.
11+
12+
<br>
13+
14+
## Instructions 📝
15+
16+
### Step 1:
17+
18+
Save the Script: Save the script code provided earlier in a file with the desired name, such as image_manipulation.py. Make sure to save it with the .py extension, indicating that it is a Python script.
19+
### Step 2:
20+
21+
Install Dependencies: Ensure that you have the necessary dependencies installed. In this case, the script relies on the Pillow library. You can install it using the pip package manager. Open a command prompt or terminal and run the following command:
22+
23+
pip install Pillow
24+
25+
### Step 3:
26+
Run the Script: Open a command prompt or terminal, navigate to the directory where the script is saved, and run the following command:
27+
python image_manipulation.py
28+
29+
### Step 4:
30+
31+
Check the Output: The script will perform the specified image manipulations based on the example usage section. The resized, rotated, and flipped images will be saved to the specified output file paths. You will see success messages for each manipulation indicating that the images have been processed and saved successfully.
32+
33+
34+
<br>
35+
36+
<hr>
37+
38+
> **Warning**
39+
>
40+
>Remember to update the file paths and manipulation parameters in the example usage section to match your specific needs.
41+
42+
Ensure that you have the Pillow library installed (pip install Pillow) before running the script.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from PIL import Image
2+
3+
def resize_image(input_image, output_image, new_size):
4+
image = Image.open(input_image)
5+
resized_image = image.resize(new_size)
6+
resized_image.save(output_image)
7+
print("Image resized and saved successfully.")
8+
9+
def rotate_image(input_image, output_image, degrees):
10+
image = Image.open(input_image)
11+
rotated_image = image.rotate(degrees)
12+
rotated_image.save(output_image)
13+
print("Image rotated and saved successfully.")
14+
15+
def flip_image(input_image, output_image, flip_mode):
16+
image = Image.open(input_image)
17+
flipped_image = image.transpose(flip_mode)
18+
flipped_image.save(output_image)
19+
print("Image flipped and saved successfully.")
20+
21+
# Example usage: Resize, rotate, and flip an image
22+
input_file = 'input_image.jpg'
23+
resized_file = 'resized_image.jpg'
24+
rotated_file = 'rotated_image.jpg'
25+
flipped_file = 'flipped_image.jpg'
26+
27+
new_size = (800, 600)
28+
degrees_to_rotate = 90
29+
flip_mode = Image.FLIP_LEFT_RIGHT
30+
31+
resize_image(input_file, resized_file, new_size)
32+
rotate_image(input_file, rotated_file, degrees_to_rotate)
33+
flip_image(input_file, flipped_file, flip_mode)

Image_text_hider/img_text_hider.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import argparse
2+
from stegano import lsb
3+
import os
4+
5+
def hide_text_in_image(image_path, text, output_path):
6+
secret_image = lsb.hide(image_path, text)
7+
secret_image.save(output_path)
8+
9+
def reveal_text_from_image(image_path):
10+
try:
11+
secret_text = lsb.reveal(image_path)
12+
return (secret_text,1) #here 1 and 0 are used to enhance script quality
13+
except UnicodeDecodeError:
14+
return ("Unable to reveal text. Decoding error occurred.",0)
15+
except IndexError:
16+
return("Failed to find message in this file format, Try using different file format like png",0)
17+
except Exception as e:
18+
return(f"Contact the owner! {e}",0)
19+
20+
def main():
21+
print("\n[Welcome to Image text hider this script can hide text inside image]\n")
22+
print("To Hide the text inside image\nUSAGE: python img_text_hider.py hide img_name_with_path.jpg 'This is my secret msg' output_file_name.jpg\n")
23+
print("To reveal the hidden text inside image\nUSAGE: python img_text_hider.py reveal hidden_img_name.jpg\n")
24+
parser = argparse.ArgumentParser(description="Image Text Hider")
25+
26+
subparsers = parser.add_subparsers(dest="command", help="Available commands")
27+
28+
# Hide command
29+
hide_parser = subparsers.add_parser("hide", help="Hide text behind an image")
30+
hide_parser.add_argument("image", help="Path to the image file")
31+
hide_parser.add_argument("text", help="Text to hide")
32+
hide_parser.add_argument("output", help="Output path for the image with hidden text")
33+
34+
# Reveal command
35+
reveal_parser = subparsers.add_parser("reveal", help="Reveal text from an image")
36+
reveal_parser.add_argument("image", help="Path to the image file")
37+
38+
args = parser.parse_args()
39+
40+
if args.command == "hide":
41+
if os.path.exists(args.image):
42+
hide_text_in_image(args.image, args.text, args.output)
43+
print("Text hidden in the image successfully. Output image saved at", args.output)
44+
else:
45+
print("Image path you specified does not exist, Make sure to check image path and file name with extention")
46+
elif args.command == "reveal":
47+
if os.path.exists(args.image):
48+
49+
revealed_text,check = reveal_text_from_image(args.image)
50+
51+
if check==1: #if works out well
52+
print(f"Revealed text: [{revealed_text}]")
53+
else: # else display with error so that user can troubleshot the problem easily
54+
print(f'Error!,{revealed_text}')
55+
56+
else:
57+
print("Image path you specified does not exist, Make sure to check image path and file name with extention")
58+
59+
if __name__ == "__main__":
60+
main()

Image_text_hider/readme.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Image Text Hider
2+
3+
This script allows you to hide text inside an image using steganography. It utilizes the LSB (Least Significant Bit) technique to embed the text into the image without visibly altering the image.
4+
5+
## Requirements
6+
7+
- Python 3.6 or above
8+
- Install the required packages by running `pip install -r requirements.txt`.
9+
10+
## Usage
11+
12+
To hide text inside an image:
13+
python img_text_hider.py hide <image_path> <text> <output_path>
14+
15+
- `<image_path>`: Path to the image file.
16+
- `<text>`: Text to hide inside the image.
17+
- `<output_path>`: Output path for the image with hidden text.
18+
19+
To reveal the hidden text from an image:
20+
python img_text_hider.py reveal <image_path>
21+
22+
- `<image_path>`: Path to the image file with hidden text.
23+
24+
## Example
25+
26+
Hide text inside an image:
27+
python img_text_hider.py hide my_image.jpg "This is my secret message" output_image.jpg
28+
29+
Reveal the hidden text from an image:
30+
python img_text_hider.py reveal output_image.jpg

0 commit comments

Comments
 (0)