Verfasst: Freitag 29. Mai 2009, 16:17
ahh ich seh schon wen ich es mit folgendem code mache
würde ich zwar ein ergebis bekommen aber dieses also print splittn[4] wäre ein zahl genauer -1 und diese zeigt er mir nicht an, gibts da ne andere möglichkeit ?
Code: Alles auswählen
fdata = open("apal26-qmda-4gev.f14","r")
while True:
for line in fdata:
# splittn = line.split()
splittn = line.split(" ")
# line.find("UQMD")
# while True:
if "UQMD" in splittn:
print splittn[0]
if ("projectile:") in splittn:
# pass
print splittn[4]
# pro = (splittn[10], splittn[11])
# print pro
# else:
# print "nicht drin"
# pro = splittn.index("projectile:")+3
# print pro
fdata.close()