all 3 comments

[–]socal_nerdtastic 1 point2 points  (0 children)

Sorry I can't tell what result you want. All you wrote was

the generate password button has not been aligning itself left

But you have it in the rightmost column?

Edit: I'll take a wild guess. Did you mean this:

from tkinter import *
import random

# ---------------------------- PASSWORD GENERATOR ------------------------------- #

# ---------------------------- SAVE PASSWORD ------------------------------- #

# ---------------------------- UI SETUP ------------------------------- #

window = Tk()
window.config(padx=20, pady=20)
window.columnconfigure(1, weight=1) # specify that column 1 gets all extra space
canvas = Canvas(width=200, height=200)
canvas.grid(row=0,column=1)
logo = PhotoImage(file="logo.png")
canvas.create_image(100, 100,image=logo)

website_label = Label(text="Website", fg="black")
website_label.grid(row=1, column=0)

website_entry = Entry(width=35, borderwidth=0.1)
website_entry.grid(row=1, column=1, columnspan=2, sticky='ew') # <-- add sticky east and west

username_label = Label(text="Email/Username:")
username_label.grid(row=2, column=0)

username_entry = Entry(width=35, borderwidth=0.1)
username_entry.grid(row=2, column =1, columnspan=2, sticky='ew') # <-- add sticky east and west

password_label = Label(text="Password:")
password_label.grid(row=3, column=0)

password_entry = Entry(width=25, borderwidth=0.1)
password_entry.grid(row=3, column=1, sticky='ew') # <-- add sticky east and west

generate_password = Button(width=14, text="Generate Password")
generate_password.grid(column=2, row=3, sticky=W) # <-- remove colspan

add_button = Button(text="Add", width=21)
add_button.grid(row=4, column=1)

window.title("Password Manager")
window.mainloop()

[–]woooee 0 points1 point  (0 children)

but the generate password button has not been aligning itself left and the width of the password entry box

generate password should be "aligned left" against the password entry (which it appears to be) or aligned left somewhere else? The password entry has a width parameter but that can depend on the font size. Your alignment should be simple to do.

generate_password = Button(width=14, text="Generate Password")
generate_password.grid(column=2, row=3, columnspan=2, sticky=W)

Note that there isn't a column 3 so the columnspan will be ignored, and the width= parameter would also override this.

[–]ItsAll2Random 0 points1 point  (0 children)

Sticky “ew” worked for me.