PyWebIO v1.4.0 Documentationcontrol to the location of content output. The output scope is a container of output content. You can create a scope in somewhere and append content to it. Each output function (function name like put_xxx()) use_scope() to clear the existing content before entering the scope: with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope of scope2') with use_scope('scope2', clear=True): # enter beginning, PyWebIO applications have only one ROOT scope. You can create new scope in a scope. For example, the following code will create 3 scopes: with use_scope('A'): put_text('Text in scope A') with0 码力 | 102 页 | 1.35 MB | 1 年前3
PyWebIO v1.2.3 Documentationin the scope: 4.1. User’s guide 15 PyWebIO, Release 1.2.3 with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope of scope2') with use_scope('scope2', clear=True): # enter the Scope stack to save the scope nesting level at runtime. For example, the following code will create 3 scopes: with use_scope('A'): put_text('Text in scope A') with use_scope('B'): put_text('Text to use_scope(), PyWebIO also provides the following scope control functions: • set_scope(name) : Create scope at current location(or specified location) • clear(scope) : Clear the contents of the scope0 码力 | 92 页 | 1.32 MB | 1 年前3
PyWebIO v1.4.0 Documentationcontrol to the location of content output. The output scope is a container of output content. You can create a scope in somewhere and append content to it. Each output function (function name like put_xxx()) put_text('text2 in scope1') # output text to scope1 with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope of scope2') with use_scope('scope2', clear=True): # enter beginning, PyWebIO applications have only one ROOT scope. You can create new scope in a scope. For example, the following code will create 3 scopes: The above code will generate the following scope layout:0 码力 | 135 页 | 7.45 MB | 1 年前3
PyWebIO v1.3.3 Documentationin the scope: 4.1. User’s guide 15 PyWebIO, Release 1.3.3 with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope of scope2') with use_scope('scope2', clear=True): # enter the Scope stack to save the scope nesting level at runtime. For example, the following code will create 3 scopes: with use_scope('A'): put_text('Text in scope A') with use_scope('B'): put_text('Text to use_scope(), PyWebIO also provides the following scope control functions: • set_scope(name) : Create scope at current location(or specified location) • clear(scope) : Clear the contents of the scope0 码力 | 100 页 | 1.34 MB | 1 年前3
PyWebIO v1.3.1 Documentationin the scope: 4.1. User’s guide 15 PyWebIO, Release 1.3.1 with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope of scope2') with use_scope('scope2', clear=True): # enter the Scope stack to save the scope nesting level at runtime. For example, the following code will create 3 scopes: with use_scope('A'): put_text('Text in scope A') with use_scope('B'): put_text('Text to use_scope(), PyWebIO also provides the following scope control functions: • set_scope(name) : Create scope at current location(or specified location) • clear(scope) : Clear the contents of the scope0 码力 | 100 页 | 1.34 MB | 1 年前3
PyWebIO v1.3.0 Documentationin the scope: 4.1. User’s guide 15 PyWebIO, Release 1.3.0 with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope of scope2') with use_scope('scope2', clear=True): # enter the Scope stack to save the scope nesting level at runtime. For example, the following code will create 3 scopes: with use_scope('A'): put_text('Text in scope A') with use_scope('B'): put_text('Text to use_scope(), PyWebIO also provides the following scope control functions: • set_scope(name) : Create scope at current location(or specified location) • clear(scope) : Clear the contents of the scope0 码力 | 100 页 | 1.34 MB | 1 年前3
PyWebIO v1.2.3 DocumentationFor example, the following code will create 3 scopes: The above code will generate the following scope layout: with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope addition to use_scope(), PyWebIO also provides the following scope control functions: set_scope(name) : Create scope at current location(or specified location) clear(scope) : Clear the contents of the scope remove(scope) above is enough to output what you want, but these outputs are arranged vertically. If you want to create a more complex layout (such as displaying a code block on the left side of the page and an image0 码力 | 119 页 | 7.43 MB | 1 年前3
PyWebIO v1.3.2 Documentationin the scope: 4.1. User’s guide 15 PyWebIO, Release 1.3.2 with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope of scope2') with use_scope('scope2', clear=True): # enter the Scope stack to save the scope nesting level at runtime. For example, the following code will create 3 scopes: with use_scope('A'): put_text('Text in scope A') with use_scope('B'): put_text('Text to use_scope(), PyWebIO also provides the following scope control functions: • set_scope(name) : Create scope at current location(or specified location) • clear(scope) : Clear the contents of the scope0 码力 | 100 页 | 1.34 MB | 1 年前3
PyWebIO v1.2.2 Documentationin the scope: 4.1. User’s guide 15 PyWebIO, Release 1.2.2 with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope of scope2') with use_scope('scope2', clear=True): # enter Scope stack to save the nesting level of scope at runtime. For example, the following code will create 3 scopes: with use_scope('A'): put_text('Text in scope A') with use_scope('B'): put_text('Text to use_scope(), PyWebIO also provides the following scope control functions: • set_scope(name) : Create scope at current location(or specified location) • clear(scope) : Clear the contents of the scope0 码力 | 92 页 | 1.35 MB | 1 年前3
PyWebIO v1.2.2 DocumentationFor example, the following code will create 3 scopes: The above code will generate the following Scope layout: with use_scope('scope2'): put_text('create scope2') put_text('text in parent scope addition to use_scope(), PyWebIO also provides the following scope control functions: set_scope(name) : Create scope at current location(or specified location) clear(scope) : Clear the contents of the scope remove(scope) need to use layout functions. The pywebio.output module provides 3 layout functions, and you can create complex layouts by combining them: put_row() : Use row layout to output content. The content is0 码力 | 119 页 | 7.41 MB | 1 年前3
共 84 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













