Replies: 2 comments 3 replies
-
One of the basic design of PyWebIO is that the input functions is blocking. Once the form is submitted, the input function returns. You cann't get the input value before it be submitted, and you cann't keep the input form alive after submission. But there is workaround to meet your need: Put textarea and subsequent operations into a while loop. from pywebio.input import *
from pywebio.output import *
code = ''
while True:
code = textarea('Text area', code={
'mode': "null",
'theme': 'darcula'
}, value=code)
# some operations with `code`
put_text(len(code)) PS: One piece of PyWebIO app development advice is: when you encounter a problem, think about what you would do if you were writing a terminal program. Because the input/output behavior of PyWebIO is consistent with the terminal program. That’s why the slogan of PyWebIO is "write interactive web app in script way". |
Beta Was this translation helpful? Give feedback.
-
Now, you can use the new feature |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use code mirror as a real-time driver for visualizations.
(The interface would be very much like flowchart.fun .)
I can keep codemirror alive using threads (see below)
But i don't know how to get the codeMirror's contents while it's alive.
(I'd also like to to override the Submit and Rest buttons.)
This may be the wrong approach, but here's where I'm at.
Thanks for your work!
Beta Was this translation helpful? Give feedback.
All reactions