parsing gcode file to extract coordinates
问题 I have a gcode file that is full of text, more specifically coordinated for a machine. I am trying to read the file, strip away the useless information so that I can then perform an operation on the coordinated before they are sent out to the machine. so far I have: file = open('TestCube.gcode','r') lines = file.readlines() file.close for line in lines: line = line.strip() Now I have a list of all the lines in the file how should I proceed in getting the relevant X and Y coordinates? sample