Hello My Fellow  geekmonsters!!!
I wrote a GUI program for a class assignment and it works perfect. Just for learning purposes I want to Build a GUI for the program But Being I'm fairly new to Tkinter I'm a little lost. I'm not sure if I'm supposed to keep all my widget/components outside of the main function or what.

heres my code

__author__ = 'apacheomega'

from tkinter import *

import sys
import time

app = Tk()
app.title("Brute Force Password Generation")
labeltext = StringVar()
labeltext.set("Enter the Password Length")
j = label1 = Label(app, textvariable = labeltext, height = 4)

def main():
    chars = 'A','B', 'C','D','E','F','G','H','I','J', 'K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'
    #print('Enter the password length')

    passwordLength = int(sys.stdin.readline())
    iPossibilities = len(chars)**passwordLength
    print("{0} words total. Press enter to continue;".format(iPossibilities))

    start = time.time()

    button_1 = Button(app, text="Run Brute Force", command=main)

    for i in range(iPossibilities):
        theword = " "
        val = i
        for j in range(passwordLength):
            (val,ch,) = divmod(val, len(chars))
            theword = chars[ch] + theword
    stop = time.time()
    print("It took {0} seconds to generate and display {1} possible combinations".format(stop-start, iPossibilities))


My window with the label pops up but neither my button or anything else I try to put in there works.
Can somebody give me a hint of what I'm Obviously doing wrong?

Thank You
AO!  apacheomega  Posts: 2Joined: Wed Jun 10, 2015 5:04 pm