Hello, i am translating a program that I wrote in perl to python, i am currently stuck on this section and it does not work.
Perl:
PYTHON: WHAT I DID!
Perl:
Code:
[while (<MAYA>) { my ($line) = $_; chomp($line); if ($line =~ /library_geometries/) { $start = 1; } if ($line =~ /<\/float_array>/) { $end = 1; } if (($start == 1) && ($end == 0)) { if ($line !~ /</) { #print GRID "$line\n"; @Split = split(/ /,$line); push @xCoords, $Split[0]; push @yCoords, $Split[1]; push @zCoords, $Split[2]; } } }]
Code:
[while Maya: { my (line) = string.rstrip(line) elif line in re.search("library_geometries"): { start == 1 } if (line == float.array) { end == 1 } if ((start == 1), (end == 0)) { if (line) { print('Line \n') array(Split) = split( array.index(Split) = split(line) push array.index(xCoords), Split(0) push array.index(yCoords), Split(1) push array.index(zCoords), Split(2) } } } } } } } ]
Comment