使用pin获取put_input组件的pin值不正确,麻烦帮忙看下原因或者有没有其他解决方法? #469
yuzipeng05
started this conversation in
Archieved
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
`from pywebio import start_server
from pywebio.output import *
from pywebio.pin import *
def button_func(name):
toast('输入是:{}'.format(name))
def fun():
datas = [
['1', '2', '3', '4'],
['5', '6', '7', '8'],
]
newdatas = []
for i, data in enumerate(datas):
content = 'content' + str(i)
tmp = data + [put_input(content, value='1'),
put_button('保存', lambda: button_func(pin[content]))]
newdatas.append(tmp)`
我希望的预期是点击第一行的保存时,能获取到第一行文本框内的值;但是发现每次获取的都是第2行的文本值。这是为什么?

Beta Was this translation helpful? Give feedback.
All reactions