TypeError: generate_user_key() missing 1 required positional argument: 'password'

TypeError: generate_user_key() missing 1 required positional argument: 'password'

我遇到这样的错误

C:\Users\visitor\PycharmProjects\pastebinhacker\venv\Scripts\python.exe C:/Users/visitor/PycharmProjects/pastebinhacker/pasteb.py
Traceback (most recent call last):
  File "C:/Users/visitor/PycharmProjects/pastebinhacker/pasteb.py", line 5, in <module>
    my_key = PastebinAPI.generate_user_key(api_dev_key,username,paa,)
TypeError: generate_user_key() missing 1 required positional argument: 'password'

Process finished with exit code 1

我看了那个模块的文档,好像没问题

from pastebin import PastebinAPI
api_dev_key = '72e257e0475e78c2eed3db0bd68088a8'
username='san1211'
paa='sadasdiuaosd'
my_key = PastebinAPI.generate_user_key(api_dev_key,username,paa,)
print (my_key)

您需要先实例化一个 PastebinAPI 对象。

然后您可以使用您的参数对该对象调用 generate_user_key

示例:

from pastebin import PastebinAPI

api_dev_key = '72e257e0475e78c2eed3db0bd68088a8'
username='san1211'
paa='12awweqqwe'

pastbinapi_object = PastebinAPI() # Create your object to work with

my_key = pastbinapi_object.generate_user_key(api_dev_key,username,paa) # Call class method on that object.
print (my_key)

结果:

40ebfabed51dd3179a3f97f37f71c213