The outdated functions

This section shows document of the deprecated functions in case you use the previous version of PyWebIO.

Those functions still work in latest PyWebIO, however they may be removed in future version.

output module, css_style)Union[pywebio.io_ctrl.Output, pywebio.io_ctrl.OutputList][source]

Customize the css style of output content

Deprecated since version 1.3: See User Guide for new way to set css style for output.

  • outputs (list/put_xxx()) – The output content can be a put_xxx() call or a list of it.

  • css_style (str) – css style string


The output contents with css style added:

Note: If outputs is a list of put_xxx() calls, the style will be set for each item of the list. And the return value can be used in anywhere accept a list of put_xxx() calls.


style(put_text('Red'), 'color:red')

], 'color:red')

    ['A', 'B'],
    ['C', style(put_text('Red'), 'color:red')],

put_collapse('title', style([
], 'margin-left:20px'))

Placeholder of output

Deprecated since version 1.5: See User Guide for new way to set css style for output.

output() can be passed in anywhere that put_xxx() can passed in. A handler it returned by output(), and after being output, the content can also be modified by the handler (See code example below).


contents – The initial contents to be output. The item is put_xxx() call, and any other type will be converted to put_text(content).


An OutputHandler instance, the methods of the instance are as follows:

  • reset(*contents) : Reset original contents to contents

  • append(*contents) : Append contents to original contents

  • insert(idx, *contents) : insert contents into original contents.

    when idx>=0, the output content is inserted before the element of the idx index.
    when idx<0, the output content is inserted after the element of the idx index.

Among them, the parameter contents is the same as output().


hobby = output(put_text('Coding'))  # equal to output('Coding')
   ['Name', 'Hobbies'],
   ['Wang', hobby]      # hobby is initialized to Coding

hobby.reset('Movie')  # hobby is reset to Movie
hobby.append('Music', put_text('Drama'))  # append Music, Drama to hobby
hobby.insert(0, put_markdown('**Coding**'))  # insert the Coding into the top of the hobby

session module


Get information about the current session

Deprecated since version 1.2: Use info instead.[source]

Get the session-local object of current session.

Deprecated since version 1.1: Use local instead.

platform module

pywebio.platform.seo(title, description=None, app=None)[source]

Set the SEO information of the PyWebIO application (web page information provided when indexed by search engines)

  • title (str) – Application title

  • description (str) – Application description

  • app (callable) – PyWebIO task function

If seo() is not used, the docstring of the task function will be regarded as SEO information by default.

seo() can be used in 2 ways: direct call and decorator:

@seo("title", "description")
def foo():

def bar():

def hello():
    """Application title

    Application description...
    (A empty line is used to separate the description and title)

    seo("title", "description", bar),

New in version 1.1.

Deprecated since version 1.4: Use pywebio.config() instead.