Please help with my gui here is the code: I want to be able to have the user type in numbers in the entry field and be able to click add, then pressing thee sort button so that the SELECTION SORT sorts it.
title = "Selection Sort GUI"
A = [64, 25, 12, 22, 11]
# Traverse through all array elements
def sort(A):
for i in range(len(A)):
# Find the minimum element in remaining
# unsorted array
smallest = i
for j in range(i+1, len(A)):
if A[smallest] > A[j]:
smallest = j
# Swap the found minimum element with
# the first element
A[i], A[smallest] = A[smallest], A[i]
# Printing sorted array
print ("Sorted array:")
print (A)
master = tk.Tk()
master.title("Dans Selection Sort")
passwordEntry = tk.Entry(master)
passwordEntry.grid(row=0, column=1)
tk.Label(master, text='Enter Number: ', font='bold',).grid(row=0, column=0)
tk.Button(master, text='Add to Array', command=lambda: sort(A)).grid(row=1, column=0)
tk.Button(master, text='Sort', command=lambda: sort(A)).grid(row=1, column=1)