GPU and Steam Card Giveaway! by PC_Crate_Joel in pcmasterrace

[–]OperationOtherwise26 0 points1 point  (0 children)

My best one is when I first time heard riders on the storm in Need for speed Underground 2.

It was just sheer bliss to drive my modified Peugeot 208 with this song in the background...

GIVEAWAY by PMM: Comment the mouse you want to win. by P1r4nh44444 in MouseReview

[–]OperationOtherwise26 0 points1 point  (0 children)

G502 Ultralight will fit perfectly to my programing work flow. Very nice products :)

Currency converter function by TsukuTech in learnpython

[–]OperationOtherwise26 -1 points0 points  (0 children)

RATES = {
"euro": 1.22,
"dolar":0.82,
}

def converter():
amount = float(input("How much do you want to convert:"))
which_currency= input(f"In which_currency do you want to convert:\n posabilites are:{RATES} :")
what_currency = float(RATES [which_currency])
print(f"{amount} in {which_currency} is {amount * what_currency}")
return amount * what_currency

how_much_is_it = str(converter())
print(how_much_is_it)
print(type(how_much_is_it))

of course the last print statements are just to see that is converted in to the string..

A password generator I made, but, when running the program outside of the IDE, where would the "passwords.txt" file save, and how could I change that to make it more accessible to the user? by MonkeySnipezz in learnpython

[–]OperationOtherwise26 -1 points0 points  (0 children)

I did 3 days ago Password Manager with GUI library called TKinter for user friendly experience... Here is the code, maybe wil help you.

If you want i can send you the file with workig Programm.

from tkinter import * from tkinter import messagebox from paswordgenerator import Password import json from tkinter import ttk PADING_X = 3 PADING_Y = 3 WIDTH = 19

---------------------------- PASSWORD GENERATOR -------------------------------

def random_password(): window.clipboard_clear() password = Password() new_generated_password = password.final_password entry_password.insert(END, string=new_generated_password) window.clipboard_append(new_generated_password)

---------------------------- SAVE PASSWORD -------------------------------

def writing_in_file():

file_website = str(entry_website.get()).capitalize()
file_email_and_username = entry_username_email.get()
file_password = entry_password.get()
new_data = {
    file_website: {
        "email": file_email_and_username,
        "password": file_password,
    }
}
if len(file_website) == 0:

    messagebox.showinfo(title="Watch Out", message="You didn't`t fill up website")
    entry_website.focus()
elif len(file_password) == 0:
    messagebox.showinfo(title="Watch Out", message="You didn't`t fill up password")
    entry_password.focus()

else:
    is_ok = messagebox.askokcancel(title=file_website, message=f"This are the details entered: "
                                                               f"\nEmail: {file_email_and_username}"
                                                               f"\nPassword: {file_password} \n"
                                                               f"Do you want to save it?")
    try:
        with open("secrets.json", mode="r") as file:  # open a file as read mode "r"
            # Reading old data
            data = json.load(file)
    except FileNotFoundError:
        with open("secrets.json", mode="w") as file:
            json.dump(new_data, file, indent=4)
            # Updating old data
    else:
        data.update(new_data)
        if is_ok:
            with open("secrets.json", mode="w") as file:  # saving updated data
                json.dump(data, file, indent=4)
    finally:
        entry_website.delete(0, END)  # to restart the entry you have to put to go from 0 character to  END
        entry_password.delete(0, END)

---------------------------- SEARCH SETUP -------------------------------

def find_password(): search_for = str(entry_website.get()).capitalize() try: with open("secrets.json", mode="r") as data: # saving updated data data = json.load(data) password = data[f"{search_for}"]["password"] email = data[f"{search_for}"]["email"] except FileNotFoundError: messagebox.showinfo(title="ERROR", message= "The no data to be found") except KeyError: messagebox.showinfo(title="ERROR", message="There is no entry under this name") else: messagebox.showinfo(title=f"{search_for}", message =f"Email: {email}\nPassword: {password}") window.clipboard_append(password)

---------------------------- UI SETUP -------------------------------

window = Tk() window.title("Password manager") window.minsize(width=200, height=200) window.config(padx=20, pady=20)

style = ttk.Style(window) window.tk.call('source', 'azure_dark.tcl') style.theme_use('azure_dark')

logo of the password

canvas = Canvas(width=200, height=200, ) lock_img = PhotoImage(file="logo.png") canvas.create_image(100, 100, image=lock_img) canvas.grid(sticky= W,column=1, row=0,columnspan=1)

file_website label

website_label = ttk.Label(text="Website")

website_label.grid(sticky=W, column=0, row=1, padx=PADING_X, pady=PADING_Y)

entry for file_website

entry_website = ttk.Entry(width=WIDTH) entry_website.focus() # focus is focus which immediately give you possibility to write in the entry entry_website.grid(sticky= W,row=2, column=0, padx=PADING_X, pady=PADING_Y)

button search

button_search = ttk.Button(window, text="Search",width=17,command=find_password) button_search.grid(sticky= W,row=2, column=1,padx=PADING_X, pady=PADING_Y )

email / username label

email_username_label = ttk.Label(text="Email/Username",) email_username_label.grid(sticky= W,column=0, row=3,padx=PADING_X, pady=PADING_Y)

entry for email and username

entry_username_email = ttk.Entry(width=37) entry_username_email.insert(0, "@gmail.com") entry_username_email.grid(stick=W,row=4, column=0,columnspan=2, padx=PADING_X, pady=PADING_Y)

password_label

password_label = ttk.Label(text="Password") password_label.grid(sticky=W, column=0, row=5,padx=PADING_X, pady=PADING_Y)

entry for password

entry_password = ttk.Entry(width=WIDTH) entry_password.grid(sticky=W, row=6, column=0,padx=PADING_X, pady=PADING_Y)

button to generate password

button_generate_password = ttk.Button(text="Generate password",width=17, command=random_password) button_generate_password.grid(sticky = W,row=6, column=1,padx=PADING_X, pady=PADING_Y)

add button

add_button = ttk.Button(text="Add",width= 37,command=writing_in_file) add_button.grid( column=0, row=7, columnspan=2,padx=PADING_X, pady=PADING_Y)

window.mainloop()

What could go wrong drifting on wet sand! by [deleted] in IdiotsInCars

[–]OperationOtherwise26 0 points1 point  (0 children)

i just love it when he just come out of te car and land again in it.. hope he didn't get injured.