Here is an example of how you could create a CompanyInfo
class.
class CompanyInfo(object): def __init__(self, name, founded_yr, empl_count): self.name = name self.founded_yr = founded_yr self.empl_count = empl_count def __str__(self): return 'Name: {}, Founded: {}, Employee Count: {}'.format(self.name, self.founded_yr, self.empl_count)
And here is an example of how you can create it:
# ... for line in open('/home/ibrahim/Desktop/Test.list'): company, founding_year, number_of_employee = line.split(',') comp_info = CompanyInfo(company, founding_year, number_of_employee)
And here is an example of how you can use it:
print "The company info is:", str(comp_info)
source share