btncmd = def read_all_file(path):
btn1 = Button(root, width=20, height=100, command=btncmd)
btn1.pack()
There is a syntax error in the btncmd part, how can I solve it?
python
def is the command used to specify a function. It should be used as follows:
def read_all_file(path):
print(path) # Example
btncmd = read_all_file(path = 1):
>> Number 1 Output
btn1 = Button(root, width=20, height=100, command=btncmd)
btn1.pack()
© 2024 OneMinuteCode. All rights reserved.