-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
haha diddy deleter/destroyer
- Loading branch information
0 parents
commit 915e84a
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import tkinter as tk | ||
from PIL import Image, ImageTk | ||
from itertools import count, cycle | ||
import requests | ||
class ImageLabel(tk.Label): | ||
def load(self, im): | ||
if isinstance(im, str): | ||
im = Image.open(im) | ||
|
||
frames = [] | ||
try: | ||
for i in count(1): | ||
frames.append(ImageTk.PhotoImage(im.copy())) | ||
im.seek(i) | ||
except EOFError: | ||
pass | ||
self.frames = cycle(frames) | ||
|
||
try: | ||
self.delay = im.info['duration'] | ||
except: | ||
self.delay = 100 | ||
|
||
if len(frames) == 1: | ||
self.config(image=next(self.frames)) | ||
else: | ||
self.next_frame() | ||
|
||
def unload(self): | ||
self.config(image=None) | ||
self.frames = None | ||
|
||
def next_frame(self): | ||
if self.frames: | ||
self.config(image=next(self.frames)) | ||
self.after(self.delay, self.next_frame) | ||
|
||
root = tk.Tk() | ||
lbl = ImageLabel(root) | ||
lbl.pack() | ||
lbl.load('diddy-baby-oil.gif') | ||
lbl.place(x=0) | ||
|
||
Logo = tk.Label(root, width=12, height=1, text="Diddy Deleter", font=("Arial", 32), background='white') | ||
Logo.place(x=70, y=50) | ||
|
||
subText = tk.Label(root, width=15, height=1, text="Webhook URL: ", font=("Arial", 10), bg="white") | ||
subText.place(x=200, y=200) | ||
|
||
textBox = tk.Text(root, width=20, height=1, font=("Helvetica", 16)) | ||
textBox.place(x=150, y= 250) | ||
|
||
def delete_webhook(): | ||
input_text = textBox.get("1.0", tk.END).strip() | ||
requests.delete(input_text) | ||
|
||
deleteButton = tk.Button(root, text="Delete", command=delete_webhook) | ||
deleteButton.place(x=250, y=300) | ||
|
||
root.configure(background="white") | ||
root.geometry("400x500") | ||
root.mainloop() |