我想从python中另一个文件中的类中导入函数和参数?

我想从python中另一个文件中的类中导入函数和参数?,python,function,class,flask,invoke,Python,Function,Class,Flask,Invoke,我正在尝试导入另一个类和其他文件中的函数及其参数。在我的文件中导入函数和参数后,我可以使用该函数获得这些值的输出,然后我将能够用html呈现它 File Name = CalculationFunc.py imports ... class calulations: def create_calculation_matrix(self,input:dict): calculation_matrix = self.calculation(input) few other

我正在尝试导入另一个类和其他文件中的函数及其参数。在我的文件中导入函数和参数后,我可以使用该函数获得这些值的输出,然后我将能够用html呈现它

File Name = CalculationFunc.py

imports ...

class calulations:

 def create_calculation_matrix(self,input:dict):
     calculation_matrix = self.calculation(input)
     few otherfucntions here()


下面是我想用input dict导入上述函数的类

File Name = mynewfile.py

from CalculationFunc import calulations
imports ...

 def get_calculation_matrix_from_other_class(self,input:dict):
     calculate_for_render = self.calculation(input)
     data = calculate_for_render 
     return render_html("pages/index.html",data = data )


如果文件在同一个文件夹中,您可以使用Tkinter读取该文件。

那么到底是什么不起作用?我看到您在哪里创建了类,我看到您在哪里导入了类,但我没有看到任何试图实际实例化类或调用所需方法的尝试。@IanMcLaird在上面的代码中,您可以看到我想要导入函数self.calculation。在我的新文件中。。不管怎样,请你指导我。
calculation
也是
calculations
课程的一员吗?因为它没有在您提供的代码中定义。