这是我的模块
def enthalpy_Q_P(q,p,f):
h1=cp.PropsSI('H','Q',q,'P',p,f)
return h1
但当我用这种方式称呼它的时候
def thermo_problem(p1,p2,t3):
f= raw_input("Enter the Fluid:")
import props
import numpy as np
h1=props.enthalpy_Q_P(0,p1,f1)
它显示为错误
thermo_problem(75e3,3e6,623)
Enter the Fluid:water
Traceback (most recent call last):
File "<ipython-input-84-6060bb46d899>", line 1, in <module>
thermo_problem(75e3,3e6,623)
File "<ipython-input-83-c72b065e1660>", line 8, in thermo_problem
h1=props.enthalpy_Q_P(0,p1,f1)
TypeError: enthalpy_Q_P() takes exactly 2 arguments (3 given)
如果这是在一个类中,你必须使用self作为你的第一个参数。你知道吗
相关问题 更多 >
编程相关推荐