The code is designed to turn a list of players/members into separate strings. The code is shown below...
Expand|Select|Wrap|Line Numbers
- class Member(object):
- '''a member'''
- fin = open ("players.txt","r")
- l= []
- for line in fin:
- line=line.strip()
- x = line.split(";")
- memb = Member()
- memb.id= x[0]
- memb.forename= x[1]
- memb.surname= x[2]
- memb.email= x[3]
- memb.phone= x[4]
- memb.divc= x[5]
- memb.pointc= x[6]
- memb.divp= x[7]
- memb.pointp= x[8]
- l.append(memb)
- fin. close ()
- print l
A;Ed;Young;e.young@lboro.ac.uk;223376;1;0;1;0
B;Gordon;McTaggart-Cowan;g.b.mctaggart@lboro.ac.uk;226276;1;0;1;0
C;Tom;Kane;t.g.kane@lboro.ac.uk;726653;1;0;1;0
D;Chris;Holmes;c.r.holmes@lboro.ac.uk;225378;1;0;1 ;0
E;David;Mulvaney;d.k.mulvaney@lboro.ac.uk;227142;1 ;0;1;0
F;James;Buller;j.buller@lboro.ac.uk;223543;1;0;1;0
A;Andrew;Wright;a.wright@lboro.ac.uk;218432;2;0;2; 0
If someone's able to shed a bit of light on why I'm getting this error code I'll be thankful as I'm not back at university until Monday.