27 lines
557 B
Python
27 lines
557 B
Python
import csv
|
|
import re
|
|
|
|
listtuple = []
|
|
linelist = []
|
|
count = 0
|
|
with open('./Workflows_js_nodes.js', 'r') as file:
|
|
for num, line in enumerate(file, 1):
|
|
if "<<<" in line:
|
|
linelist.append(num)
|
|
if ">>>" in line:
|
|
linelist.append(num)
|
|
linelist = sorted(linelist)
|
|
x = len(linelist)
|
|
|
|
try:
|
|
while count in range(x):
|
|
count += 1
|
|
temp_tupe = (linelist[0], linelist[1])
|
|
listtuple.append(temp_tupe)
|
|
linelist.pop(0)
|
|
linelist.pop(1)
|
|
except IndexError as e:
|
|
print(e)
|
|
|
|
print(listtuple)
|