📜  EasyGUI – 文本框

📅  最后修改于: 2022-05-13 01:55:47.514000             🧑  作者: Mango

EasyGUI – 文本框

文本框:用于向/从用户显示和获取文本,文本可以使用任何键盘输入进行编辑,它以字符串的形式输入。它显示标题、要显示的消息、更改给定文本的位置和一对用于确认文本的“确定”、“取消”按钮。它类似于输入文本,但用于显示大文本并对给定文本进行自动换行,下面是输入框的样子

例子 :
在此我们将创建一个带有可编辑文本的文本框,并根据更改后的文本在屏幕上显示特定文本,下面是实现

# importing easygui module
from easygui import *
  
# message to be displayed
message = "Below is the text to edit"
  
# window title
title = "Window Title GfG"
  
# long text
text = ["EasyGUI is a module for very simple, very easy GUI ",
"programming in Python. EasyGUI is different from other",
"GUI generators in that EasyGUI is NOT event-driven."]
          
# creating a multi password box
output = textbox(message, title, text)
  
# showing the output
print("Alterted Text ")
print("================")
print(output)

输出 :

Alterted Text 
================
EasyGUI is a module for very simple, very easy GUI programming in Python. EasyGUI is different from otherGUI generators in that EasyGUI is NOT event-driven. geeksforgeeks

另一个例子 :
在此我们将创建一个没有任何可编辑文本的文本框,并根据更改后的文本在屏幕上显示特定文本,下面是实现

# importing easygui module
from easygui import *
  
# message to be displayed
message = "Below is the text to edit"
  
# window title
title = "Window Title GfG"
  
          
# creating a multi password box
output = textbox(message, title)
  
# showing the output
print("Alterted Text ")
print("================")
print(output)

输出 :

Alterted Text 
================
Welcome to geeksforgeeks ajkbkjbajxblcblc;c