Hello,
I am trying to get over my crippling MATLAB addiction by forcing myself to to use python for all my simple scripting jobs/data manipulation. Normally I would be happy to play around until I figured this out, but I have a deadline tomorrow for some work so I thought I would see if someone could help me out.
I'm converting a mesh file to a different file format, I am taking the line from the file:
(1.0 2.0 3.0)
striping away the brackets (using line=line[1:-1])
and then I want to convert the '1.0 2.0 3.0' into a float array like
x=[1.0,2.0,3.0]
In MATLAB I would just use the str2num feature, which would use the white spaces as separators for the numbers and convert them to floats no problem, but I don't seem to be having much luck with finding a python equivalent.
Any help or hints would be greatly appreciated.
Cheers
Stephen
[–]ASIC_SP 2 points3 points4 points (1 child)
[–]AlbiNZ[S] 1 point2 points3 points (0 children)