python 구문오류 및 함수 추가로 넣는법
조회수 366회
btncmd = def read_all_file(path):
btn1 = Button(root, width=20, height=100, command=btncmd)
btn1.pack()
btncmd 부분에서 구문오류가 나는데 해결을 어떻게 해야하나요?
-
(•́ ✖ •̀)
알 수 없는 사용자
1 답변
-
def는 함수를 지정할 때 사용하는 명령어입니다. 다음과 같이 사용해야 합니다.
def read_all_file(path): print(path) # 예시 btncmd = read_all_file(path = 1): >> 숫자 1 출력 btn1 = Button(root, width=20, height=100, command=btncmd) btn1.pack()
댓글 입력