By restart the loop i’m assuming u mean call it again
the easiest way to do is would be to make it a recursive function
def fn():
for index, line in enumerate(lines):
if line[:8] == Token.INCLUDE:
system("python3 {} {}".format(argv[0], argv[1]))
del lines[index]
#make sure to add your conditions else it will go into an infinite loop.
fn()
5
solved Python restart for loop