PyWebIO v1.8.0 Documentationput_table([ ['Commodity', 'Price'], ['Apple', '5.5'], ['Banana', '7'], ]) # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image.png') use_scope(). use_scope() You can use use_scope() to open and enter a new output scope, or enter an existing output scope: with use_scope('scope1'): # open and enter a new output: 'scope1' put_text('text1 server to continuously provide services. When the user accesses the service address, PyWebIO will open a new session and run PyWebIO application in it. start_server() is the most common way to start a0 码力 | 118 页 | 1.40 MB | 1 年前3
PyWebIO v1.8.2 Documentationput_table([ ['Commodity', 'Price'], ['Apple', '5.5'], ['Banana', '7'], ]) # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image.png') use_scope(). use_scope() You can use use_scope() to open and enter a new output scope, or enter an existing output scope: with use_scope('scope1'): # open and enter a new output: 'scope1' put_text('text1 server to continuously provide services. When the user accesses the service address, PyWebIO will open a new session and run PyWebIO application in it. start_server() is the most common way to start a0 码力 | 118 页 | 1.40 MB | 1 年前3
PyWebIO v1.8.1 Documentationput_table([ ['Commodity', 'Price'], ['Apple', '5.5'], ['Banana', '7'], ]) # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image.png') use_scope(). use_scope() You can use use_scope() to open and enter a new output scope, or enter an existing output scope: with use_scope('scope1'): # open and enter a new output: 'scope1' put_text('text1 server to continuously provide services. When the user accesses the service address, PyWebIO will open a new session and run PyWebIO application in it. start_server() is the most common way to start a0 码力 | 118 页 | 1.40 MB | 1 年前3
PyWebIO v1.8.1 Documentationfinal output: You can pass put_xxx() calls to put_table() as cell content: # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image “current scope”. The “current scope” is set by use_scope(). use_scope() You can use use_scope() to open and enter a new output scope, or enter an existing output scope: The results of the above code are put_text('5.5').onclick(lambda: toast('You click the text'))], ]) with use_scope('scope1'): # open and enter a new output: 'scope1' put_text('text1 in scope1') # output text to scope1 put_text('text0 码力 | 160 页 | 7.47 MB | 1 年前3
PyWebIO v1.8.2 Documentationfinal output: You can pass put_xxx() calls to put_table() as cell content: # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image “current scope”. The “current scope” is set by use_scope(). use_scope() You can use use_scope() to open and enter a new output scope, or enter an existing output scope: The results of the above code are put_text('5.5').onclick(lambda: toast('You click the text'))], ]) with use_scope('scope1'): # open and enter a new output: 'scope1' put_text('text1 in scope1') # output text to scope1 put_text('text0 码力 | 160 页 | 7.47 MB | 1 年前3
PyWebIO v1.8.0 Documentationfinal output: You can pass put_xxx() calls to put_table() as cell content: # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image “current scope”. The “current scope” is set by use_scope(). use_scope() You can use use_scope() to open and enter a new output scope, or enter an existing output scope: The results of the above code are put_text('5.5').onclick(lambda: toast('You click the text'))], ]) with use_scope('scope1'): # open and enter a new output: 'scope1' put_text('text1 in scope1') # output text to scope1 put_text('text0 码力 | 159 页 | 7.47 MB | 1 年前3
PyWebIO v1.8.2 使用手册['Commodity', 'Price'], ['Apple', '5.5'], ['Banana', '7'], ]) # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image and save to server f = input.file_upload("Upload a file") open('asset/'+f['filename'], 'wb').write(f['content']) imgs = file_upload("Select some pictures:", accept="image/*" 函数的同名参数含义 一致 Example: img = open('/path/to/some/image.png', 'rb').read() put_image(img, width='50px') put_image('https://www.python.org/static/img/python-logo.png') content = open('./some-file', 'rb').read()0 码力 | 160 页 | 7.48 MB | 1 年前3
PyWebIO v1.8.1 使用手册['Commodity', 'Price'], ['Apple', '5.5'], ['Banana', '7'], ]) # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image and save to server f = input.file_upload("Upload a file") open('asset/'+f['filename'], 'wb').write(f['content']) imgs = file_upload("Select some pictures:", accept="image/*" 函数的同名参数含义 一致 Example: img = open('/path/to/some/image.png', 'rb').read() put_image(img, width='50px') put_image('https://www.python.org/static/img/python-logo.png') content = open('./some-file', 'rb').read()0 码力 | 158 页 | 7.48 MB | 1 年前3
PyWebIO v1.8.0 使用手册['Commodity', 'Price'], ['Apple', '5.5'], ['Banana', '7'], ]) # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image and save to server f = input.file_upload("Upload a file") open('asset/'+f['filename'], 'wb').write(f['content']) imgs = file_upload("Select some pictures:", accept="image/*" 函数的同名参数含义 一致 Example: img = open('/path/to/some/image.png', 'rb').read() put_image(img, width='50px') put_image('https://www.python.org/static/img/python-logo.png') content = open('./some-file', 'rb').read()0 码力 | 157 页 | 7.48 MB | 1 年前3
PyWebIO v1.8.2 使用手册['Commodity', 'Price'], ['Apple', '5.5'], ['Banana', '7'], ]) # Image Output put_image(open('/path/to/some/image.png', 'rb').read()) # local image put_image('http://example.com/some-image and save to server f = input.file_upload("Upload a file") open('asset/'+f['filename'], 'wb').write(f['content']) imgs = file_upload("Select some pictures:", accept="image/*" 函数的同名参数含义 一致 Example: img = open('/path/to/some/image.png', 'rb').read() put_image(img, width='50px') put_image('https://www.python.org/static/img/python-logo.png') content = open('./some-file', 'rb').read()0 码力 | 158 页 | 7.48 MB | 1 年前3
共 86 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













