-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreader.py
48 lines (35 loc) · 887 Bytes
/
reader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import ursina
import sys
def split(file):
temp_list = []
temp_str = ""
add_to_list = False
num = 0
num2 = 0
len_line = 0
linestr = []
with open(file) as f:
lines = f.readlines()
for line in lines:
num += 1
for char in line:
num2 += 1
if num2 == 1 and char == "[":
add_to_str = True
if add_to_str == True:
if len(line) > 1:
temp_str += line
if line[1] == "/":
add_to_list = True
add_to_str = False
if add_to_list == True:
temp_list.append(temp_str)
temp_str = ""
add_to_list = False
num2 = 0
return temp_list
def parse(block):
pass
if __name__ == "__main__":
if len(sys.argv) == 2:
print(split(sys.argv[1]))