Reputation: 23
I want to upload a file by a file entry and then when I click on "Save" I want to get the path of this selected file.
The next step would be to create either a .txt
or a yaml
file with this path in it as output.
Could someone help me with this?
win.addFileEntry("InputFile")
def press(button):
if button == "Exit":
win.stop()
if button == "Save":
print(path._getfullpathname(__file__))
print("Saved!")
win.addButtons(["Add", "Remove", "Save", "Load", "Exit"], press)
Upvotes: 0
Views: 126
Reputation: 273
You just need to ask the FileEntry for its contents:
filename = win.getEntry('InputFile')
Upvotes: 0