0

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)
ComplicatedPhenomenon
  • 4,055
  • 2
  • 18
  • 45

1 Answers1

0

You just need to ask the FileEntry for its contents: filename = win.getEntry('InputFile')

R.Jarvis
  • 273
  • 2
  • 8