import sys MALE = 0 FEMALE = 1 class Peep: self.name self.sex self.age def read_file(filename): with open(filename) as f: for line in f: yield [b.strip() for b in line.split(':')] peeps = [] for l in read_file(sys.argv[1]): Peep p p.name = l[0] p.sex = MALE if l[1] == 'M' else FEMALE p.age = int(l[2]) peeps.append()
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15129 | zachwhaley | Add practice directory |