Tell me more ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I just finished my program, but i cant figure out a part of it please help, it always says syntax error.

#!/usr/bin/python
#use warning
from numpy import*
import re
import os
import math
import math
import fileinput

filename = raw_input('Enter Filename:')
os.mkdir(filename)
print('Created Filename:'), filename

Maya = open('Test.dae', 'r') #
Grid = open('Grid.txt', 'w') #
TEMP = open('temp.txt', 'w') #

start = 0
end= 0
buffer = 2 # - Number of Z  eroes around the Shape
print('Constraints: \t')
print('Basic = 0\t')
print('Gradient = 1\t')
print('Choice:\n')

constraint = raw_input('Constraint: ')

entry_cost = raw_input('Clean-up zone Entry Cost: ')

xcoords = []
ycoords = []
zcoords = []

for line in MAYA:
  line = line.rstrip()

  if "library_geometries" in line: start = True
  if "</float_array>" in line: end = True

  if start and not end:
    if '<' not in line:
      # GRID.write(line + '\n')

        if ((start == 1), (end == 0))

            if(line)
                {
                    print('Line \n')

                    array(Split) = split(
                    array.index(Split) = split(line)
                    list.append[xcoords], Split(0)
                    list.append[ycoords], Split(1)
                    list.append[zcoords], Split(2)


                          }
                    }
                }
            }
        }
    }
}
share|improve this question

closed as off topic by Michael K Aug 16 '11 at 19:45

Questions on Code Review Stack Exchange are expected to relate to code review request within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

You seem to have been trying use {} as block delimiters in the last part of the code, either out of habit from another language or because you are trying to port the code from another language and forgot to remove them.

Remove all the {}s, and remember ":" after if-statements.

This will hopefully clear up the syntax errors. If not, it would be a bit easier for us to help you if you specified which line the error occurs on.

share|improve this answer
Sorry, for all the mistakes. Thanks for all the suggestions, I am really used to perl. – MIT Aug 16 '11 at 20:24
Also, the error occurs on whenever I am trying to identifya variables such as Split = split(line), and wherever i put an = sign – MIT Aug 16 '11 at 20:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.