Skip to content

Commit 2f54e89

Browse files
dmesquitawang0618
andauthored
put_image example using bytes-like object (#172)
* put_image example using bytes-like object * Update docs/guide.rst Co-authored-by: WangWeimin <wang0.618@qq.com> Co-authored-by: WangWeimin <wang0.618@qq.com>
1 parent ba01978 commit 2f54e89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/guide.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ Using output functions, you can output a variety of content, such as text, table
215215
## ----
216216

217217
# Image Output
218-
put_image('some-image.png') # ..doc-only
218+
put_image(open('/path/to/some/image.png', 'rb').read()) # local image # ..doc-only
219+
put_image('http://example.com/some-image.png') # internet image # ..doc-only
219220
put_image('https://www.python.org/static/img/python-logo.png') # ..demo-only
220221
## ----
221222

@@ -796,4 +797,4 @@ ask yourself a question: What would I do if it is in a terminal program?
796797
If you already have the answer, it can be done in the same way with PyWebIO. If the problem persists or the solution is
797798
not good enough, you can consider the :ref:`callback mechanism <callback>` or :doc:`pin <./pin>` module.
798799

799-
OK, Have fun with PyWebIO!
800+
OK, Have fun with PyWebIO!

0 commit comments

Comments
 (0)