且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python 未绑定方法类型错误

更新时间:2022-12-05 17:29:11

您报告了这个错误:

TypeError: unbound method get_pos() 必须以应用程序实例作为第一个参数调用(什么都没有)

TypeError: unbound method get_pos() must be called with app instance as first argument (got nothing instead)

用外行人的话来说,这意味着你正在做这样的事情:

What this means in layman's terms is you're doing something like this:

class app(object):
    def get_pos(self):
        ...
...
app.get_pos()

你需要做的是这样的:

the_app = app()  # create instance of class 'app'
the_app.get_pos() # call get_pos on the instance

很难得到比这更具体的信息,因为您没有向我们展示导致错误的实际代码.

It's hard to get any more specific than this because you didn't show us the actual code that is causing the errors.