代码之家  ›  专栏  ›  技术社区  ›  Fiddy Bux

Easygui输出到Easygui对话?

  •  1
  • Fiddy Bux  · 技术社区  · 7 年前

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

    3 回复  |  直到 7 年前
        1
  •  2
  •   James Romo    6 年前
    easygui.msgbox('hello world', title='hello world', ok_button = 'yes')
    

    这是一种发布easygui消息的方法

        2
  •  1
  •   Fiddy Bux    7 年前

    结果需要从预先声明的变量传递到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
  •  0
  •   joshua robbins    4 年前
    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"))
    

    msgbox输出一条简单的小消息

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