Skip to content

Examples

1. 创建一个简单的程序

python
from pywebio.input import input
from pywebio.output import put_text

name = input("What is your name?")
put_text(f"Hello, {name}!")

2. 创建一个简单的表单

python
from pywebio.input import input
from pywebio.output import put_text

name = input("What is your name?")
put_text(f"Hello, {name}!")

3. 创建一个简单的表格

python
from pywebio.input import input
from pywebio.output import put_table

name = input("What is your name?")
put_table([
  ['Name', 'Age'],
  [name, 20]
])

4. 创建一个简单的下拉菜单

python
from pywebio.input import input
from pywebio.output import put_text

name = input("What is your name?")
put_text(f"Hello, {name}!")

5. 创建一个简单的按钮

python
from pywebio.input import input
from pywebio.output import put_text

name = input("What is your name?")
put_text(f"Hello, {name}!")