我的程序如下:#-*-coding:mbcs-*-importmathdefmakenetwork(s4):fp=open(s1+s4+s2)forlineinfp:(K,X,Y)=line.split()klist.append(int(K))dataX.append(float(X))dataY.append(float...
我的程序如下:
#-*-coding:mbcs -*-
import math
def makenetwork(s4):
fp=open(s1+s4+s2)
for line in fp:
(K,X,Y)=line.split()
klist.append(int(K))
dataX.append(float(X))
dataY.append(float(Y))
fp.close()
fp=open(s3+s4+s2,"w+")
fp1=open(s5+s4+s2,"w+")
for i in xrange(99999):
for j in xrange(i+1,100000):
a=(dataY[j]-dataY[i])/(dataX[j]-dataX[i])
b=(dataY[j]+dataY[i]-a*(dataX[j]+dataX[i]))/2.0
temp=1
for k in xrange(i+1,j):
flag=a*dataX[k]+b
if dataY[k]>flag:
temp=0
break
if temp==1:
fp.write("%d\t%d\t",(i+1,j+1))
fp.write("%d\t%d\t",(i+1,j+1))
angle=180*math.atan(a)/3.141592653+90.0
fp.write("%-4.2f\n",angle)
fp.close()
fp.close()
s1="F:\\keyanfiles\\uniformtimeseries\\result-timeseries\\timeseries-"
s2=".txt"
s3="F:\\keyanfiles\\uniformtimeseries\\result-network\\network-"
s5="F:\\keyanfiles\\uniformtimeseries\\network\\network-"
klist=[]
dataX=[]
dataY=[]
for n in range(1,2):
s4=str(n)
makenetwork(s4)
我明明只给一个参数,为什么出现以下错误啊?求指导。
TypeError: function takes exactly 1 argument <1 given>
展开