cost 254 ms
`TypeError: missing 1 required positional argument: 'self'` 白盒工具 - `TypeError: missing 1 required positional argument: 'self'` Whitebox tools

我正在尝试使用白盒地理空间工具来分析 .tif 文件。 但是,我运行的任何白盒工具都会引发错误: TypeError: missing 1 required positional argument: 'self' 。 我知道这是堆栈溢出社区中一个有据可查的错误,但是,根据我对 self 参数的理解, ...

从 Rust 中的方法内部创建新线程时如何正确使用 self - How to properly use self when creating a new thread from inside a method in Rust

我正在创建一个服务器,将 TcpStream 对象存储在 Vec 中以备后用。问题是 function 侦听新连接并将它们添加到 Vec 中永远在一个单独的线程中运行并且不允许其他线程读取Vec。 在当前示例中,服务器接受连接但不允许主线程读取连接向量。我努力让 listen function 以 ...

我如何访问在我的 class 的 __init__ 中声明的变量之一 - How can I access variables declared in __init__ of my class in one of it's functions

所以我想在我的任何属于 Canvas class 的函数中获取变量,但由于某种原因它不会重新定义其中的任何一个。 我认为通过将 self 放在开头它会得到它但它没有所以我尝试以其他方式缩进它但也没有用。 ...

类自我表现得像整数 - class self acts like integer

我不明白为什么。 它会引发错误“int”对象没有属性“v”,但我想访问 self.v。 当我只打印自己时,它会打印一些数字。 我不明白发生了什么事。 这是我的代码。 问题出现在b == self.v我想将self.v值分配给一个变量。 ...

在 Ruby 中,初始化 class 时传递“self”是如何工作的? - In Ruby how does it work when passing "self" when initialising a class?

我遇到了以下问题的解决方案,并且正在努力理解attach_tail! 方法。 这个Knot.new(self)究竟是如何工作的? 一般而言,创建 class 的新实例时传递 self 是做什么的? 该程序的想法比这更广泛,本质上是关于一个“结”的头部在网格周围移动,然后是尾部,在 class 中有 ...

Cant properly orginize self method in a class TypeError:create_bool(): incompatible function arguments. 支持以下参数类型: - Cant properly orginize self method in a class TypeError:create_bool(): incompatible function arguments. The following argument types are supported:

当我尝试生成 class 时返回错误。 当我在这里尝试时https://github.com/google/mediapipe/blob/master/docs/solutions/face_mesh.md#python-solution-api 。 一切都是完美的自己有点问题。 方法。 但我无法 ...

有没有办法在 Python 中获取已使用 self 和 append 数据初始化的列表属性? - Is there a way to grab list attributes that have been initialized using self and append data to them in Python?

我在 Python 中有一个 class 用于初始化环境的属性。 我试图在一个单独的 function 中获取我的环境 class 的 topographyRegistry 属性列表,调用它时,应该接受“self”参数和要添加的地形。 当这个 function 被调用时,它应该简单地采用诸如 ad ...

在运行时使用 importlib 创建 class 时缺少参数 - missing argument when using importlib to create a class at runtime

我想在用户输入文件名时动态加载 Python 文件(模块)(例如: RegionOfInterest.py )。 文件中将包含一个 class(此处为: RegionOfInterest )。 所有类都有一个我想调用的同名方法(此处为: start )。 这工作正常,但如果我从 start 方法调用 ...

使用函数初始化数据类实例 - Initialize dataclass instance with functions

我正在尝试创建一个数据类以将所有相关数据存储在一个 object 中。如何初始化一个数据类实例,其中值是从数据类中的函数求值的,这些函数采用参数? 这是我到目前为止的位置: 当前output:Person(name=('John', 'Smith'), age='100') 这是我要实现的 out ...

Class Inheritance python 需要填写子 class 名称 - Class Inheritance python require fill child class name

这可能是一个愚蠢的问题,因为我是 Python 的新手。 但是,我希望有人能解释一下,因为我试图找到很多资源,但仍然很难理解背后的机制。 所以我创建了一个父 Class 和一个子 Class。 父 Class 有 set_name, get_name 方法在 Child Class 中,我定义了一个 ...

使用 type(name, base, dict) 方法创建的 object 是否有 self 参数? - Is there self parameter for an object created using type(name, base, dict) method?

有没有办法在使用type()方法创建的 object 上模拟 self 参数的使用? 我希望能够访问用于调用该方法的 object。 如果我定义了 class 那么我将能够使用self参数访问该 object。 但是是否可以对使用type()创建的 object 做同样的事情? 在下面的示例中,我 ...

如何从一个 Class 到另一个引用字典列表? - How to Reference List of Dicitionaries from One Class to Another?

我目前正在开发一个库存系统,并尝试实现一个 class 作为我的数据库的“快速事实优化器”,该数据库由我的数据库管理 class 管理。 csv 文件如下所示: 我有以下代码: 上面的 class 管理字典列表,通过添加项目、删除项目等的几种方法(为了简单起见,不包括在内)。 我也有这个 cl ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM