TypeError:decorator()缺少1个必需的位置参数:'f'[关闭]

问题描述 投票:-2回答:1

我遇到一个错误(已安装Python 3.8.2):

import click
@click.command
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name", help="The person to greet.")
def hello(count, name):
    for _ in range(count):
        click.echo("Hello, {name}!")
if __name__ == '__main__':
    hello()

返回:

Traceback (most recent call last):
  File "c:/py/myKonsole/kclick.py", line 12, in <module>
    hello()
TypeError: decorator() missing 1 required positional argument: 'f'

我尝试安装pyhton 3.4.4,但不起作用

python python-3.x python-click
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.