Skip to content

输出停顿问题 #171

Answered by wang0618
mubidiy asked this question in Q&A
Oct 14, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

使用 pywebio.input.actions() 来阻塞式获取用户选择:

# coding=utf-8
import pywebio
from pywebio.input import *
from pywebio.output import *
from pywebio.session import *


def main():
    sent_list = ['我爱国', '我爱家']
    for sent in sent_list:
        with use_scope('newpage', clear=True):
            put_markdown('## 句子展示')
            put_text(sent)
            keep = actions("是否保留", ['是', '否'])
            if keep == '是':
                pass


if __name__ == '__main__':
    pywebio.start_server(main, port=8080, debug=True, cdn=False)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by mubidiy
Comment options

You must be logged in to vote
2 replies
@wang0618
Comment options

@mubidiy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants