【问题标题】:How do I get the path of a file I want to upload by a file entry?如何通过文件条目获取要上传的文件的路径?
【发布时间】:2019-07-18 05:28:48
【问题描述】:

我想通过文件条目上传文件,然后当我点击“保存”时,我想获取这个选定文件的路径。

下一步将创建一个.txtyaml 文件,其中包含此路径作为输出。

有人可以帮我解决这个问题吗?

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)

【问题讨论】:

标签: python path appjar


【解决方案1】:

您只需要向 FileEntry 询问其内容: filename = win.getEntry('InputFile')

【讨论】:

    猜你喜欢
    • 2018-12-11
    • 2017-05-31
    • 1970-01-01
    • 2010-11-20
    • 1970-01-01
    • 2017-04-14
    • 2016-01-14
    • 2014-06-08
    • 1970-01-01
    相关资源
    最近更新 更多