Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 14.614, 14.624, 14.512, 14.615, etc.
- ff = open('AvailableTickets.txt', 'r').read()
- ff2 = ff
- ff = ff.replace(',', '')
- ff = ff.split()
- ff = map(float, ff)
- if len(ff) < 10:
- ff3 = open('TestTickets.txt', 'r+')
- ff3.write(str(ff2))
- else:
- ff3 = open('TestTickets.txt', 'r+')
- for x in range(0, 10):
- ff3.write(str(ff[len(ff)-x])+', ')
- with open('AvailableTickets.txt', 'r') as fin:
- tickets_raw = fin.read()
- tickets_list = tickets_raw.split(', ')
- with open('TestTickets.txt', 'a') as f:
- if len(tickets_list) < 10:
- f.write(tickets_raw)
- else:
- f.write(', '.join(tickets_list[-10:]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement