import modules you need #read the file here. there should be examples around (basically open, read, close) #example, http://www.network-theory.co.uk/docs/pytut/MethodsofFileObjects.html #lines should contain the read lines. or could handle some other way coordlist= [] for line inf lines: xyzcoords= [] coords= line.split() xyzcoords.append(coords) #check that appends like [item1, item2, item3] ! not 100 % sure about this coordlist.append(xyzcoords) print coordlist # should contain list containing xyz coord lists #use coords to plot