pysimplegui popup_get_folder default_path

发布于 2025-02-10 15:58:40 字数 384 浏览 2 评论 0原文

我对pysimplegui的popup_get_folder有问题。我无法设置默认路径,我会收到错误: popup()有一个意外的关键字参数“ default_path”,我该怎么办? popup_get_folder()有一个参数“ default_path”

if event == "BUTTON":
        dirfiles = sg.popup_get_folder('Please enter a folder name')
        sg.popup('Results', 'The value returned from popup_get_folder', dirfiles, default_path="C:/Users/User/Desktop/NEWFOLDER")

i have a problem with popup_get_folder, PySimpleGUI. i can't set default path, I get error:
popup() got an unexpected keyword argument 'default_path', what can i do? popup_get_folder() has an argument "default_path"

if event == "BUTTON":
        dirfiles = sg.popup_get_folder('Please enter a folder name')
        sg.popup('Results', 'The value returned from popup_get_folder', dirfiles, default_path="C:/Users/User/Desktop/NEWFOLDER")

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一刻暧昧 2025-02-17 15:58:40

查看错误消息错误:popup()获得了一个意外的关键字参数'default_path'

python告诉我们引起错误的函数:popup

它也告诉我们错误IS:您在参数default_path中传递时,当这不是popup函数所期望的东西时。

要查找可以传递到弹出函数的参数,您可以查看库的文档: https://pysimplegui.readthedocs.io/en/latest/#high-level-level-level-api-calls-popups

popup(args=*<1 or N object>,
    title = None,
    button_color = None,
    background_color = None,
    text_color = None,
    button_type = 0,
    auto_close = False,
    auto_close_duration = None,
    custom_text = (None, None),
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    any_key_closes = False,
    image = None,
    modal = True)

Looking at the error message error: popup() got an unexpected keyword argument 'default_path'

Python tells us the function that's causing the error: popup

It also tells us what the error is: you passed in the argument default_path when this is not something that the popup function is expecting.

To find out what arguments you can pass to the popup function, you can look at the documentation for the library: https://pysimplegui.readthedocs.io/en/latest/#high-level-api-calls-popups

popup(args=*<1 or N object>,
    title = None,
    button_color = None,
    background_color = None,
    text_color = None,
    button_type = 0,
    auto_close = False,
    auto_close_duration = None,
    custom_text = (None, None),
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    any_key_closes = False,
    image = None,
    modal = True)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文