def getFromFile():
'''Input polar coord. from .csv: returns a list of (x,y,0).
The file must be ";" separated: column A = radius, column B = angle'''
from PySide import QtGui
fileIn=open(QtGui.QFileDialog().getOpenFileName()[0],'r')
lines=fileIn.readlines()
fileIn.close()
xyCoord=[]
for line in lines:
polarCoord=line.split(';')
xyCoord.append(polar2xy(float(polarCoord[0]),float(polarCoord[1])*math.pi/180))
return xyCoord
评论列表
文章目录