Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python read file with class

class Main(object):
    def __init__(self, thing1, thing2):
        self.thing1 = thing1
        self.thing2 = thing2
with open('Your file') as f:
    data = [i.strip().split() for i in f.readlines()]
 
PREVIOUS NEXT
Tagged: #python #read #file #class
ADD COMMENT
Topic
Name
5+7 =