PyWebIO icon indicating copy to clipboard operation
PyWebIO copied to clipboard

Write interactive web app in script way.

Results 80 PyWebIO issues
Sort by recently updated
recently updated
newest added

Slider support?

[{"_id":"635449bbcecf4e081a1c7ceb","body":"Slider input is already added to plan with a new feature, please stay tuned.","issue_id":1660699579988,"origin_id":837822468,"user_origin_id":8682073,"create_time":1620709609,"update_time":1620709609,"id":1666468283966,"updated_at":"2022-10-22T19:51:23.965000Z","created_at":"2022-10-22T19:51:23.965000Z"},{"_id":"635449bbcecf4e081a1c7cec","body":"Slider input was added in version 1.3. See https:\/\/pywebio.readthedocs.io\/en\/latest\/input.html#pywebio.input.slider","issue_id":1660699579988,"origin_id":864420926,"user_origin_id":8682073,"create_time":1624116628,"update_time":1624117770,"id":1666468283969,"updated_at":"2022-10-22T19:51:23.969000Z","created_at":"2022-10-22T19:51:23.969000Z"},{"_id":"635449bbcecf4e081a1c7cee","body":"> Slider input was added in version 1.3. See https:\/\/pywebio.readthedocs.io\/en\/latest\/input.html#pywebio.input.slider\r\n\r\nYes it exists in the docs, but when i try to implement it in my code, it says the name 'slider' is not defined.\r\nIn fact I even checked the input.py file, there is no implementation of slider\r\n\r\n\r\n","issue_id":1660699579988,"origin_id":891721306,"user_origin_id":28635478,"create_time":1627985680,"update_time":1627986038,"id":1666468283974,"updated_at":"2022-10-22T19:51:23.973000Z","created_at":"2022-10-22T19:51:23.973000Z"},{"_id":"635449bbcecf4e081a1c7cef","body":"Can slider display a number, for example\uff0cvalue\u3001min_value\u3001max_value=100\r\nslider(label=\"\u8bf7\u9009\u62e9\u6570\u503c\uff1a\",value=5, min_value=1, max_value=100, step=1\r\n![2](https:\/\/user-images.githubusercontent.com\/48554616\/143832986-a0884494-67b1-4342-b97d-de4832b40f5a.png)\r\n)\r\n","issue_id":1660699579988,"origin_id":981394853,"user_origin_id":48554616,"create_time":1638174483,"update_time":1638174483,"id":1666468283991,"updated_at":"2022-10-22T19:51:23.991000Z","created_at":"2022-10-22T19:51:23.991000Z"},{"_id":"635449bbcecf4e081a1c7cf0","body":"@wujianming604 Thanks for feedback, I will add this feature in next version.","issue_id":1660699579988,"origin_id":981397626,"user_origin_id":8682073,"create_time":1638174731,"update_time":1638174731,"id":1666468283994,"updated_at":"2022-10-22T19:51:23.994000Z","created_at":"2022-10-22T19:51:23.994000Z"},{"_id":"635449bbcecf4e081a1c7cf1","body":"Thanks !!","issue_id":1660699579988,"origin_id":981400206,"user_origin_id":48554616,"create_time":1638174970,"update_time":1638174970,"id":1666468283996,"updated_at":"2022-10-22T19:51:23.996000Z","created_at":"2022-10-22T19:51:23.996000Z"},{"_id":"635449bbcecf4e081a1c7cf2","body":"@wujianming604 forget to update, value label for slider input was already available since v1.5","issue_id":1660699579988,"origin_id":1236150911,"user_origin_id":8682073,"create_time":1662221077,"update_time":1662221077,"id":1666468283999,"updated_at":"2022-10-22T19:51:23.999000Z","created_at":"2022-10-22T19:51:23.999000Z"}] comment

Requesting a feature add - **slider**. For multi-parameter apps, a slider is a natural choice for many situations. Especially, it gives **an idea about the range of values to experiment**...

bug

Markdown不支持画流程图

[{"_id":"635453eaea01ec786e77bee3","body":"Will add this to our backlog, but cannot commit a timeline to support it as for now.","issue_id":1660699579991,"origin_id":980491368,"user_origin_id":18755763,"create_time":1637981780,"update_time":1637981780,"id":1666470890327,"updated_at":"2022-10-22T20:34:50.327000Z","created_at":"2022-10-22T20:34:50.327000Z"}] comment

![image](https://user-images.githubusercontent.com/12101941/143535578-fcba0ee3-76d4-4efb-b4bc-a469a2f3ab8a.png) 这个功能挺实用的

enhancement

pywebio + Django

[{"_id":"635444a58041c95dfb11f72a","body":"\u76ee\u524d\u53ea\u80fd\u5728django\u4e2d\u4f7f\u7528pywebio\u521b\u5efa\u65b0\u9875\u9762\uff0c\u8fd8\u4e0d\u80fd\u5d4c\u5165\u5230\u73b0\u6709\u7684\u9875\u9762","issue_id":1660699579993,"origin_id":957335057,"user_origin_id":8682073,"create_time":1635850956,"update_time":1635850956,"id":1666466981954,"updated_at":"2022-10-22T19:29:41.954000Z","created_at":"2022-10-22T19:29:41.954000Z"},{"_id":"635444a58041c95dfb11f72b","body":"> \u6211\u60f3\u5728Django\u7684\u81ea\u5e26\u7684admin\u7ba1\u7406\u540e\u53f0\u4e2d\u4f7f\u7528pywebio+\u56fe\u8868\u7684\u529f\u80fd \u50cf\u8fd9\u6837\uff1a ![image](https:\/\/user-images.githubusercontent.com\/39975240\/139824242-aaa8c9ed-d04d-445a-8a7b-be536d742056.png) \u600e\u4e48\u5b9e\u73b0\u5462\uff1f^_^\r\n\r\n\u56fe\u7247\u505a\u4e00\u4e2a\u5fae\u670d\u52a1,\u7136\u540eifname\u5d4c\u5165,\u53ef\u4ee5\u5c1d\u8bd5\u4e0b","issue_id":1660699579993,"origin_id":979724099,"user_origin_id":12101941,"create_time":1637907717,"update_time":1637907717,"id":1666466981958,"updated_at":"2022-10-22T19:29:41.958000Z","created_at":"2022-10-22T19:29:41.958000Z"}] comment

我想在Django的自带的admin管理后台中使用pywebio+图表的功能 像这样: ![image](https://user-images.githubusercontent.com/39975240/139824242-aaa8c9ed-d04d-445a-8a7b-be536d742056.png) 怎么实现呢?^_^

enhancement

output_max_width not implemented in set_env

[{"_id":"63545564d297b6213230ce3e","body":"okay, this feature seems to be in development branch...","issue_id":1660699579999,"origin_id":900984992,"user_origin_id":45203900,"create_time":1629280879,"update_time":1629280879,"id":1666471268609,"updated_at":"2022-10-22T20:41:08.609000Z","created_at":"2022-10-22T20:41:08.609000Z"},{"_id":"63545564d297b6213230ce3f","body":"okay , I have a version supporting \"output_max_width\"\r\nAnd I am trying to put a relativly wide table on screen, and even with output_max_width=90%. or 1080px gives no sense - table is presented really narrow with scroll bar.\r\nI also tried a layouts with width= set, and it did worked, but center alignment of table is ruined then.","issue_id":1660699579999,"origin_id":901030879,"user_origin_id":45203900,"create_time":1629285505,"update_time":1629285505,"id":1666471268612,"updated_at":"2022-10-22T20:41:08.611000Z","created_at":"2022-10-22T20:41:08.611000Z"},{"_id":"63545564d297b6213230ce40","body":"Try add `pywebio.session.run_js(\"\"\"$('head').append(`<style>td *{white-space: nowrap!important;}<\/style>`)\"\"\")` before you put_table. ","issue_id":1660699579999,"origin_id":901063247,"user_origin_id":8682073,"create_time":1629288886,"update_time":1629288886,"id":1666471268614,"updated_at":"2022-10-22T20:41:08.614000Z","created_at":"2022-10-22T20:41:08.614000Z"}] comment

Documentation for version 1.3.* describes set_env function including "output_max_width" parameter. But setting this parameter leads to assertion violation: ` assert all(k in ('title', 'output_animation', 'auto_scroll_bottom', 'http_pull_interval', 'input_panel_min_height', 'input_panel_init_height', 'input_panel_fixed', 'input_auto_focus')...

bug

Error message from browser console

[{"_id":"63544645cecf4e081a1c7a70","body":"Also another error message from Python runtime terminal:\r\nWARNING:tornado.access:404 GET \/css\/codemirror.min.css.map (::1) 4.00ms\r\nWARNING:tornado.access:404 GET \/css\/bootstrap.min.css.map (::1) 4.00ms\r\nWARNING:tornado.access:404 GET \/sm\/40f738e33ed5dbe7907b48c3be4b63e977eab6cb49c8df4f76f3edc3f1f2fb0d.map (::1) 3.00ms\r\nWARNING:tornado.access:404 GET \/js\/FileSaver.min.js.map (::1) 1.00ms\r\nWARNING:tornado.access:404 GET \/js\/popper.min.js.map (::1) 4.39ms\r\nWARNING:tornado.access:404 GET \/js\/bootstrap.min.js.map (::1) 6.14ms\r\nWARNING:tornado.access:404 GET \/js\/bs-custom-file-input.min.js.map (::1) 71.48ms\r\nWARNING:tornado.access:404 GET \/sm\/b2692762f762f02a544ce708819ce22427514c155203d0627f14174806ee9f38.map (::1) 73.49ms","issue_id":1660699580003,"origin_id":872897631,"user_origin_id":11355010,"create_time":1625221968,"update_time":1625221968,"id":1666467397424,"updated_at":"2022-10-22T19:36:37.424000Z","created_at":"2022-10-22T19:36:37.424000Z"},{"_id":"63544645cecf4e081a1c7a71","body":"The 404 error for not found `*.map` files is as expected ","issue_id":1660699580003,"origin_id":873083450,"user_origin_id":8682073,"create_time":1625239826,"update_time":1625239826,"id":1666467397429,"updated_at":"2022-10-22T19:36:37.428000Z","created_at":"2022-10-22T19:36:37.428000Z"}] comment

Error(TypeError: Cannot read property 'update_input' of undefined at Object.n.PinUpdate (http://localhost:8080/js/pywebio.min.js:1:94250) at e.value (http://localhost:8080/js/pywebio.min.js:1:52041) at e.value (http://localhost:8080/js/pywebio.min.js:1:38406) at e._on_server_message (http://localhost:8080/js/pywebio.min.js:1:62057) at WebSocket.ws.onmessage (http://localhost:8080/js/pywebio.min.js:1:97515)) in dispatch command: pin_update (anonymous) @ main.ts:51 ws.onmessage...

bug

[feature request] Output method to display video in browser

[{"_id":"63544b3cea01ec786e77b8d1","body":"Video streaming is a very interesting use case, however, the tricky part is how do you handle your back-end content delivery network? It's very challenging to globally deliver high-quality live streaming services over the internet. I think a workaround can be using a 3rd party stream API or service, then embedding an HTML block using `put_html()` in your app. \r\n\r\nThoughts?","issue_id":1660699580007,"origin_id":858251712,"user_origin_id":18755763,"create_time":1623295737,"update_time":1623295752,"id":1666468668465,"updated_at":"2022-10-22T19:57:48.465000Z","created_at":"2022-10-22T19:57:48.465000Z"},{"_id":"63544b3cea01ec786e77b8d2","body":"Interesting idea. This is what I tried just now:\r\n\r\n```\r\nimport cv2\r\nfrom pywebio.output import put_html\r\n\r\ncap = cv2.VideoCapture(0)\r\n\r\nwhile True:\r\n if cap.grab():\r\n flag, frame = cap.retrieve()\r\n if not flag:\r\n continue\r\n else:\r\n cv2.imwrite(\"image.png\", frame)\r\n html = \"<html><img src='image.png'><\/html\"\r\n put_html(html)\r\n```\r\n\r\nIts a simple webcam stream. And the idea is to save each frame in the video stream as an image, convert the image into an html object, and use `put_html()` to display the output in browser. But it produces blank images, and also seems to try to display the images next to each other instead of replacing the previous image with the current one (to give the appearance of a video). Any ideas on how to make it work?\r\n\r\n<img width=\"1076\" alt=\"Screenshot 2021-06-10 at 4 17 25 PM\" src=\"https:\/\/user-images.githubusercontent.com\/39755678\/121490162-5be13600-ca07-11eb-9444-71cde0cf013d.png\">\r\n\r\nI also tried saving each image as an html file, and then reading that html file, but I get the same output:\r\n\r\n```\r\n...\r\n...\r\nelse:\r\n cv2.imwrite(\"image.png\", frame)\r\n html_str = \"<html><img src='image.png'><\/html\"\r\n Html_file= open(\"filename.html\",\"w\")\r\n Html_file.write(html_str)\r\n Html_file.close()\r\n with open(\"filename.html\", 'r') as f:\r\n html = f.read()\r\n put_html(html)\r\n```\r\n\r\nI also tried displaying each image directly using `put_image()`, and it displays each image one below the other, it doesn't replace the previous image with the current one:\r\n\r\n```\r\nimport cv2\r\nfrom pywebio.output import put_image\r\n\r\ncap = cv2.VideoCapture('path\/to\/video.mp4') # or leave as 0 for webcam\r\n\r\nwhile True:\r\n if cap.grab():\r\n flag, frame = cap.retrieve()\r\n if not flag:\r\n continue\r\n else:\r\n cv2.imwrite(\"image.png\", frame)\r\n put_image(open('image.png', 'rb').read())\r\n```\r\n\r\n<img width=\"1276\" alt=\"Screenshot 2021-06-10 at 4 32 54 PM\" src=\"https:\/\/user-images.githubusercontent.com\/39755678\/121492508-859b5c80-ca09-11eb-855f-5d2b93e4cbf6.png\">\r\n\r\n","issue_id":1660699580007,"origin_id":858410545,"user_origin_id":39755678,"create_time":1623312627,"update_time":1623314713,"id":1666468668471,"updated_at":"2022-10-22T19:57:48.471000Z","created_at":"2022-10-22T19:57:48.471000Z"},{"_id":"63544b3cea01ec786e77b8d3","body":"I tried `use_scope()` (https:\/\/pywebio.readthedocs.io\/en\/latest\/guide.html#use-scope) and `time.sleep()` to only keep one image at a time. The caveat of this workaround is the fade-in effect upon clearing a scope. \r\n\r\n```\r\nimport cv2\r\nfrom pywebio.output import *\r\nimport time\r\n\r\ncap = cv2.VideoCapture(0)\r\n\r\nwhile True:\r\n\t\r\n if cap.grab():\r\n flag, frame = cap.read()\r\n if not flag:\r\n continue\r\n else:\r\n cv2.imwrite(\"image.png\", frame)\r\n img = open(\"image.png\", 'rb').read() \r\n #put_image(img)\r\n\r\n with use_scope('stream', clear=True): \r\n put_image(img)\r\n time.sleep(0.5)\r\n```","issue_id":1660699580007,"origin_id":859235586,"user_origin_id":18755763,"create_time":1623382107,"update_time":1623382107,"id":1666468668475,"updated_at":"2022-10-22T19:57:48.475000Z","created_at":"2022-10-22T19:57:48.475000Z"},{"_id":"63544b3cea01ec786e77b8d4","body":"@helincao \r\n> The caveat of this workaround is the fade-in effect upon clearing a scope.\r\n\r\nThe fade-in effect can be turn off by `pywebio.session.set_env(output_animation=False)`","issue_id":1660699580007,"origin_id":859591329,"user_origin_id":8682073,"create_time":1623418958,"update_time":1623418958,"id":1666468668478,"updated_at":"2022-10-22T19:57:48.478000Z","created_at":"2022-10-22T19:57:48.478000Z"},{"_id":"63544b3cea01ec786e77b8d5","body":"> The fade-in effect can be turn off by `pywebio.session.set_env(output_animation=False)`\r\n\r\nThanks for this suggestion. Where exactly in the code should this line be? I put it at the end, and it doesn't do anything.","issue_id":1660699580007,"origin_id":859606362,"user_origin_id":39755678,"create_time":1623420336,"update_time":1623420336,"id":1666468668481,"updated_at":"2022-10-22T19:57:48.480000Z","created_at":"2022-10-22T19:57:48.480000Z"},{"_id":"63544b3cea01ec786e77b8d6","body":"> > The fade-in effect can be turn off by `pywebio.session.set_env(output_animation=False)`\r\n> \r\n> Thanks for this suggestion. Where exactly in the code should this line be? I put it at the end, and it doesn't do anything.\r\n\r\n@PrashantSaikia You should put the `set_env()` at the beginning of your code.","issue_id":1660699580007,"origin_id":859607897,"user_origin_id":8682073,"create_time":1623420467,"update_time":1623420467,"id":1666468668483,"updated_at":"2022-10-22T19:57:48.483000Z","created_at":"2022-10-22T19:57:48.483000Z"},{"_id":"63544b3cea01ec786e77b8d7","body":"Tried it just now. Still the same, no change.","issue_id":1660699580007,"origin_id":859608508,"user_origin_id":39755678,"create_time":1623420519,"update_time":1623420519,"id":1666468668485,"updated_at":"2022-10-22T19:57:48.485000Z","created_at":"2022-10-22T19:57:48.485000Z"},{"_id":"63544b3cea01ec786e77b8d8","body":"Indeed, there is file reading\/writing latency that prevents your \"streaming\" from being smooth and yields this flicker effect. This is pretty much how far you can get using the currently available PyWebIO modules. A dedicated module for streaming output is not a trivial task, and we do not have a plan to support it by the end of 2021 yet. However, things can change if the demand for this module becomes high :)","issue_id":1660699580007,"origin_id":860852719,"user_origin_id":18755763,"create_time":1623691029,"update_time":1623691029,"id":1666468668488,"updated_at":"2022-10-22T19:57:48.488000Z","created_at":"2022-10-22T19:57:48.488000Z"},{"_id":"63544b3cea01ec786e77b8d9","body":"is there any road maps which features will be added on in the curse of time? @helincao ","issue_id":1660699580007,"origin_id":862629213,"user_origin_id":32805117,"create_time":1623869642,"update_time":1623869642,"id":1666468668492,"updated_at":"2022-10-22T19:57:48.491000Z","created_at":"2022-10-22T19:57:48.491000Z"},{"_id":"63544b3cea01ec786e77b8da","body":"It's not there at this moment. An open roadmap or to-do list might be an interesting idea. Let us do a little exploration and see how to support it. If you have ideas, please join our Discord server for brainstorming: https:\/\/discord.gg\/MvaCcg76Z7","issue_id":1660699580007,"origin_id":862888756,"user_origin_id":18755763,"create_time":1623900229,"update_time":1623900250,"id":1666468668495,"updated_at":"2022-10-22T19:57:48.494000Z","created_at":"2022-10-22T19:57:48.494000Z"},{"_id":"63544b3cea01ec786e77b8db","body":"Thanks @helincao for introducing me to the group.\r\njust joined.","issue_id":1660699580007,"origin_id":862980359,"user_origin_id":32805117,"create_time":1623912819,"update_time":1623912819,"id":1666468668497,"updated_at":"2022-10-22T19:57:48.496000Z","created_at":"2022-10-22T19:57:48.496000Z"}] comment

I am making a computer vision [app](https://github.com/PrashantSaikia/Body-Movement-Comparison-with-Mediapipe) where I need to display the webcam stream on the browser. Is there a way to do this currently in pywebio? For example,...

bug

Please move to [Discussions - Feature Request](https://github.com/wang0618/PyWebIO/discussions/categories/feature-request) for posting. Currently, the temporary solution is to do: ``` $('head').append('') $('head').append('') ``` I am hoping we could get a more direct way...

enhancement

功能正常运行就是报个错误 In [2]: import pywebio In [3]: pywebio.__version__ Out[3]: '1.2.3' python3.8 chat_room.py Listen on 0.0.0.0:8080 ERROR:tornado.application:Uncaught exception GET /?app=index&session=NEW (::1) HTTPServerRequest(protocol='http', host='localhost:8080', method='GET', uri='/?app=index&session=NEW', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call...

bug

Flask 2 integration

[{"_id":"63544495d297b6213230c0ff","body":"I will add support for Flask 2.0 recently, while also maintaining compatibility with previous versions.","issue_id":1660699580017,"origin_id":840933155,"user_origin_id":8682073,"create_time":1620955418,"update_time":1620955418,"id":1666466965041,"updated_at":"2022-10-22T19:29:25.041000Z","created_at":"2022-10-22T19:29:25.041000Z"}] comment

Flask 2.0 has been released, and routing has been upgraded. Is there any needs for us to upgrade the documentation of PyWebIO?

性能怎么样

[{"_id":"635454763056137e265a358a","body":"\u5176\u5b9ePyWebIO\u8bbe\u8ba1\u4e4b\u521d\uff0c\u8bbe\u60f3\u7684\u5e94\u7528\u573a\u666f\u662f\u4e0d\u592a\u9700\u8981\u5f3a\u7528\u6237\u53cb\u597d\u6027\u7684\u5185\u90e8\u5de5\u5177\u6216\u8005\u81ea\u7528\u670d\u52a1\uff0c\u8fd9\u4e9b\u573a\u666f\u4e0b\u90fd\u4e0d\u592a\u9700\u8981\u9ad8\u5e76\u53d1\uff0c\u6240\u4ee5\u5728\u6027\u80fd\u65b9\u9762\u6ca1\u6709\u8fdb\u884c\u8fc7\u5b9a\u91cf\u7684\u6d4b\u8bd5\u3002\r\n\u4e0d\u8fc7PyWebIO\u5728\u534f\u7a0b\u4e0b\uff0c\u9664\u4e86\u901a\u4fe1\u534f\u8bae\u4f7f\u7528\u7684websocket\u5916\uff0c\u548c\u666e\u901a\u7684Web\u5e94\u7528\u4e0d\u5b58\u5728\u672c\u8d28\u533a\u522b\uff0c\u81ea\u8ba4\u4e3a\u9ad8\u5e76\u53d1\u95ee\u9898\u4e0d\u5927\u3002","issue_id":1660699580020,"origin_id":835822544,"user_origin_id":8682073,"create_time":1620572118,"update_time":1620572118,"id":1666471030716,"updated_at":"2022-10-22T20:37:10.715000Z","created_at":"2022-10-22T20:37:10.715000Z"},{"_id":"635454763056137e265a358b","body":"> \r\n> \r\n> \u5176\u5b9ePyWebIO\u8bbe\u8ba1\u4e4b\u521d\uff0c\u8bbe\u60f3\u7684\u5e94\u7528\u573a\u666f\u662f\u4e0d\u592a\u9700\u8981\u5f3a\u7528\u6237\u53cb\u597d\u6027\u7684\u5185\u90e8\u5de5\u5177\u6216\u8005\u81ea\u7528\u670d\u52a1\uff0c\u8fd9\u4e9b\u573a\u666f\u4e0b\u90fd\u4e0d\u592a\u9700\u8981\u9ad8\u5e76\u53d1\uff0c\u6240\u4ee5\u5728\u6027\u80fd\u65b9\u9762\u6ca1\u6709\u8fdb\u884c\u8fc7\u5b9a\u91cf\u7684\u6d4b\u8bd5\u3002\r\n> \u4e0d\u8fc7PyWebIO\u5728\u534f\u7a0b\u4e0b\uff0c\u9664\u4e86\u901a\u4fe1\u534f\u8bae\u4f7f\u7528\u7684websocket\u5916\uff0c\u548c\u666e\u901a\u7684Web\u5e94\u7528\u4e0d\u5b58\u5728\u672c\u8d28\u533a\u522b\uff0c\u81ea\u8ba4\u4e3a\u9ad8\u5e76\u53d1\u95ee\u9898\u4e0d\u5927\u3002\r\n\r\n\u8c22\u8c22","issue_id":1660699580020,"origin_id":835982750,"user_origin_id":61260513,"create_time":1620607125,"update_time":1620607125,"id":1666471030722,"updated_at":"2022-10-22T20:37:10.721000Z","created_at":"2022-10-22T20:37:10.721000Z"}] comment

看起来非常酷,用于生产环境的话,性能怎么样,看文档支持协程,高并发场景下应该能hold住吧