0
ATM 인터페이스를 시뮬레이트하는 코드를 만들었지 만 2 단계에서는 버그가있는 것 같습니다. 1 단계 : 그것은 계정 만들 데프 간다 "생성"선택 : 열립니다 3 단계 : 계좌 번호 입력 : 2 단계는 은행 계정 선택/생성 요청 (? 변수 사용 보인다 정의되지 않은) 오류를 내가보고 해달라고 문제, 어쩌면 내가 장님하지만 난 그 오류를 일으킬 수있는 참조하십시오. 내 변수가 왜 : userAnswer는 항상 정의되지 않은 상태로 되돌아옵니다. 이 라인에서Python, tkinter 팝업 창 오류 팝업
import tkinter
x=''
bankList = ['100','101','102','103','104','105','106','107','108','109']
def checkAccount():
number = userAnswer.get()
if number == '1':#in bankList:
print("That Account already exist, try another number.")
else:
bankList.append(number)
print("Your new account has been created!")
def createAccount():
window2 = tkinter.Tk()
window2.title("Creating an Account!")
window2.geometry("400x100")
accountLabel = tkinter.Label(window2, text="Please input the 3 digit number for the Account: ")
userAnswer = tkinter.Entry(window2)
accountButton = tkinter.Button(window2, text="Go", command=checkAccount)
accountLabel.pack()
userAnswer.pack()
accountButton.pack()
def selectAccount():
print("nope")
#------------------------- Opening Text Box: Create/Choose Account
window = tkinter.Tk()
window.title("ATM - Inovated Online Banking")
window.geometry("400x100")
label = tkinter.Label(window, text="Thank you for using online Banking Canada. Howe can we help you?")
button = tkinter.Button(window, text="Create Account", command=createAccount)
button2 = tkinter.Button(window, text="Select Account", command=selectAccount)
label.pack()
button.pack()
button2.pack()