def isThereAFirstWord(firstWord, lines, startIndex):
 for lineIndex in xrange(startIndex, len(lines)):
  line = lines[lineIndex]
  splitLine = getSplitLineBeforeBracketSemicolon(line)
  if (firstWord == getFirstWord(splitLine)):
   return True
 return False

def isThereAFirstWord ( firstWord , lines , startIndex ) : for lineIndex in xrange ( startIndex , len ( lines ) ) : line = lines [ lineIndex ] splitLine = getSplitLineBeforeBracketSemicolon ( line ) if ( firstWord == getFirstWord ( splitLine ) ) : return True return False
parse gcode until the first word if there is one .