python from bottle import route, run @route('/hello/<name>') def hello(name): return f'Hello, {name}!' run(host='localhost', port=8080) python from bottle import route, template, run @route('/hello/<name>') def hello(name): return template('hello_template', name=name) run(host='localhost', port=8080) python from bottle import route, static_file, run @route('/static/<filename:path>') def serve_static(filename): return static_file(filename, root='/path/to/static/files') run(host='localhost', port=8080) python from bottle import route, run @route('/hello/<name>') def hello(name): return f'Hello, {name}!' run(host='localhost', port=8080)


上一篇:
下一篇:
切换中文