【问题标题】:Easygui output to easygui dialogue?Easygui输出到easygui对话?
【发布时间】:2020-11-25 19:55:45
【问题描述】:

如何将easygui 输出到easygui 对话框,而不是调用x.py 的终端。

如果我从终端运行我的 python 脚本,easygui 对话框会出现并且可以工作,但是输出显示在终端中而不是 easygui。

【问题讨论】:

    标签: python-3.x easygui


    【解决方案1】:
    easygui.msgbox('hello world', title='hello world', ok_button = 'yes')
    

    这是一种输出easygui msg的方法

    【讨论】:

      【解决方案2】:

      结果需要从预先声明的变量传递到 easygui 语法中。比如……

      somemsg = "Some message"
      sometitle = "Some title"
      someresult = "Some result or text to include in easygui frame"
      
      easygui.textbox(msg=somemsg, title=sometitle, text=someresult)
      

      【讨论】:

        【解决方案3】:
        from easygui import *
        
        name = "josh"
        image = "gfg.png"
        message = ("hello, my name is",name)
        
        msgbox(message)
        textbox(message)
        input = buttonbox("message",image = image,choices=("hello","goodbye"))
        

        我根本不需要使用任何其他的 easygui 框,除了 enterbox。

        msgbox 输出一个简单的小消息

        文本框用于较大的输出

        buttonbox 提供输入选项以响应输出。它还允许输出图像。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-04-25
          • 1970-01-01
          相关资源
          最近更新 更多