I am making a language in Python for my Computer Science class, and I need to know how to read certain parts of a line in a file. For instance, if there is a "for" in the first part, then read whats in the "()", then check for a "{", then go to the next line. I tried using "if x in line:", but this doesn't make sure it's in the right order. I also can not figure out how to get only a small portion of the line, such as the first three letters, or the next three letters after the first three. I am trying to make this without having to the characters as single variables, or as a list. I prefer to have the small portion saved as a string, to implement this part into another script after it reads the line.
