Heho, > open file > while not at eof > read first line > if firstchar on line is not "#" > print line > else > go onto next line a=open(file,"r") for i in a: if i[1] <> '#': print i a.close() .. may also be if i[0] <> ... whatever the "firstchar" means to you