-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext_file.py
More file actions
48 lines (35 loc) · 1.2 KB
/
text_file.py
File metadata and controls
48 lines (35 loc) · 1.2 KB
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 utils
class text_file:
lines = []
def gather_lines_from_file( filename ):
with open(filename) as f:
lines = f.readlines()
self.lines = lines
def discard_lines_from_file():
correct_lines = []
comment = False
asterisk = False
data_in_that_line = True
for l in lines:
interpreted_line = []
working_chars = []
last_char = ""
i = 0
data_in_that_line = True
if comment == True:
data_in_that_line = False
for i in range(0, len(l)):
c = l[i]
if c == "/"
if l[i + 1] == "/"
if i == 0
data_in_that_line = False
comment = True
i = i + 1
if comment == False and data_in_that_line == True:
correct_lines_string = ''.join(correct_lines)
correct_lines.append(correct_lines_string)
self.lines = correct_lines
def __init__( filename )
gather_lines_from_file( filename )
discard_lines_from_file()