Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- states = {}
- states_order = []
- with open("fort.24") as f:
- for line in f:
- if line[0] == "5":
- state_no, spin, sym = line.split()[-3:]
- spin_sym = spin + sym
- states[int(state_no)] = spin_sym
- if spin_sym not in states_order:
- states_order.append(spin_sym)
- idtarg = []
- for spin_sym in states_order:
- for state_no in states.keys():
- if states[state_no] == spin_sym:
- idtarg.append(state_no)
- print idtarg
Advertisement
Add Comment
Please, Sign In to add comment