PyWebIO v1.2.3 Documentation
message will be returned: def check_age(p): # return None when the check passes, otherwise return the error ˓→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How prompt Parameters • shape (str) – The shape of loading prompt. The available values are: 'border' (de- fault) 'grow' • color (str) – The color of loading prompt. The available values are: 'primary' 'secondary' success, danger, warning, info, light, dark. Example: put_buttons([dict(label='primary', value='p', color='primary')], ˓→onclick=...) • onclick (callable / list) – Callback which will be called when0 码力 | 92 页 | 1.32 MB | 1 年前3PyWebIO v1.2.2 Documentation
message will be returned: def check_age(p): # return None when the check passes, otherwise return the error ˓→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How prompt Parameters • shape (str) – The shape of loading prompt. The available values are: 'border' (de- fault) 'grow' • color (str) – The color of loading prompt. The available values are: 'primary' 'secondary' success, danger, warning, info, light, dark. Example: put_buttons([dict(label='primary', value='p', color='primary')], ˓→onclick=...) • onclick (callable / list) – Callback which will be called when0 码力 | 92 页 | 1.35 MB | 1 年前3PyWebIO v1.4.0 Documentation
message will be returned: def check_age(p): # return None when the check passes, otherwise return the error ˓→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How max_size (int/str) – The maximum size of a single file, exceeding the limit will prohibit uploading. The de- fault is 0, which means there is no limit to the size. max_size can be a integer indicating the number prompt Parameters • shape (str) – The shape of loading prompt. The available values are: 'border' (de- fault) 'grow' 36 Chapter 4. Documentation PyWebIO, Release 1.4.0 • color (str) – The color of loading0 码力 | 102 页 | 1.35 MB | 1 年前3PyWebIO v1.3.3 Documentation
message will be returned: def check_age(p): # return None when the check passes, otherwise return the error ˓→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How prompt Parameters • shape (str) – The shape of loading prompt. The available values are: 'border' (de- fault) 'grow' • color (str) – The color of loading prompt. The available values are: 'primary' 'secondary' for put_text() Example: import time o = output("You can click the area to prevent auto scroll.") put_scrollable(o, height=200, keep_bottom=True) while 1: o.append(time.time()) time.sleep(0.5) 4.30 码力 | 100 页 | 1.34 MB | 1 年前3PyWebIO v1.3.1 Documentation
message will be returned: def check_age(p): # return None when the check passes, otherwise return the error ˓→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How prompt Parameters • shape (str) – The shape of loading prompt. The available values are: 'border' (de- fault) 'grow' • color (str) – The color of loading prompt. The available values are: 'primary' 'secondary' for put_text() Example: import time o = output("You can click the area to prevent auto scroll.") put_scrollable(o, height=200, keep_bottom=True) while 1: o.append(time.time()) time.sleep(0.5) 4.30 码力 | 100 页 | 1.34 MB | 1 年前3PyWebIO v1.3.0 Documentation
message will be returned: def check_age(p): # return None when the check passes, otherwise return the error ˓→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How prompt Parameters • shape (str) – The shape of loading prompt. The available values are: 'border' (de- fault) 'grow' • color (str) – The color of loading prompt. The available values are: 'primary' 'secondary' for put_text() Example: import time o = output("You can click the area to prevent auto scroll.") put_scrollable(o, height=200, keep_bottom=True) while 1: o.append(time.time()) time.sleep(0.5) 4.30 码力 | 100 页 | 1.34 MB | 1 年前3PyWebIO v1.3.2 Documentation
message will be returned: def check_age(p): # return None when the check passes, otherwise return the error ˓→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How prompt Parameters • shape (str) – The shape of loading prompt. The available values are: 'border' (de- fault) 'grow' • color (str) – The color of loading prompt. The available values are: 'primary' 'secondary' for put_text() Example: import time o = output("You can click the area to prevent auto scroll.") put_scrollable(o, height=200, keep_bottom=True) while 1: o.append(time.time()) time.sleep(0.5) 4.30 码力 | 100 页 | 1.34 MB | 1 年前3PyWebIO v1.4.0 Documentation
text', required=True) def check_age(p): # return None when the check passes, otherwise return the error message if p < 10: return 'Too young!!' if p > 60: When the user input an illegal invoked with one argument, the set_value. set_value is a callable object, which is invoked with one o two arguments. You can use set_value to set the value for the input. set_value can be invoked with one young' input('Input your age', type=NUMBER, validate=check_age) Returns: Parameters: Returns: p y When calling set_value with two arguments, the input item in web page will become read-only. The0 码力 | 135 页 | 7.45 MB | 1 年前3PyWebIO v1.2.3 使用手册
我们可以为输入指定校验函数,校验函数应在校验通过时返回 None,否则返回错误消息: def check_age(p): # return None when the check passes, otherwise return the error␣ �→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How 、success 、danger 、warning 、info 、light 、dark Example: put_buttons([dict(label='primary', value='p', color='primary')],␣ �→onclick=...) • onclick (callable / list) –按钮点击回调函数. onclick 可以是函数或者函 数组成的列表 import time o = output("You can click the area to prevent auto scroll.") put_scrollable(o, height=200, keep_bottom=True) (下页继续) 50 Chapter 4. Documentation PyWebIO, 发布 1.2.3 (续上页) while 1: o.append(time0 码力 | 102 页 | 1.67 MB | 1 年前3PyWebIO v1.2.2 使用手册
我们可以为输入指定校验函数,校验函数应在校验通过时返回 None,否则返回错误消息: def check_age(p): # return None when the check passes, otherwise return the error␣ �→message if p < 10: return 'Too young!!' if p > 60: return 'Too old!!' age = input("How 、success 、danger 、warning 、info 、light 、dark Example: put_buttons([dict(label='primary', value='p', color='primary')],␣ �→onclick=...) • onclick (callable / list) –按钮点击回调函数. onclick 可以是函数或者函 数组成的列表 Documentation PyWebIO, 发布 1.2.2 import time o = output("You can click the area to prevent auto scroll.") put_scrollable(o, height=200, keep_bottom=True) while 1: o.append(time.time()) time.sleep(0.5) 在0 码力 | 102 页 | 1.69 MB | 1 年前3
共 86 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9