代码:
import click from flask import Flask app = Flask(__name__) @app.cli.command() def hg(): click.echo('lalalal')
运行:
>>>flask hg lalalal
参考文档:
https://dormousehole.readthedocs.io/en/stable/cli.html#virturalenv