Python Function() 正好接受 2 个参数(给出 3 个)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17874744/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Function() takes exactly 2 arguments (3 given)
提问by vaibhav
I am using python to call a method in one class that is in one file from a method in another class of other file
我正在使用 python 从其他文件的另一类中的方法调用一个文件中的一个类中的方法
Suppose my file is abc.py
that contains
假设我的文件abc.py
包含
class data :
def values_to_insert(a,b):
......
......
another file is def.py
另一个文件是 def.py
import abc
class values:
data=abc.data()
def sendvalues():
a=2
b=3
data.values(a,b)
When I run this file it gives an error: values() takes exactly 2 arguments (3 given)
当我运行这个文件时,它给出了一个错误: values() takes exactly 2 arguments (3 given)