0
Hello I am creating a program to create projects only when starting the program to see if started the window, where asks the path and the name of the project I came across this error
Traceback (Most recent call last): File "F: Projects Project Creator main.py", line 24, in main(main values) Attributeerror: 'Function' Object has no attribute 'values'
I don’t know what to do!
Here’s my file code main py.
import PySimpleGUI as sg
import criar_pasta
def main(values):
layout = [
[sg.Text("Insira o nome do projeto")], [sg.Input(key="nome_do_projeto")],
[sg.Text("Insira a path do projeto")], [sg.Input(key="path")],
[sg.Button("Criar ficheiro de programação")], [sg.Button("Cancelar")]
]
window = sg.Window("Project creator", layout=layout)
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
break
if event == "Cancelar":
break
if event == "Criar ficheiro de programação":
criar_pasta.criar_pasta()
window.close()
if __name__ == '__main__':
main(values)```
The oblema is in:
if __name__ == '__main__': main(values)
. You did not initializevalues
– Paulo Marques
I didn’t realize, is that I don’t understand very well about modules... The problem is in the
if __name__ == "__main__": main(values)
?– Devilas