Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pdb
- def short_ids(short_id_file):
- """This function expects a short_id file and returns a list with all
- short_ids."""
- short_id_list = []
- invalid_ids = []
- with open(short_id_file) as data_file:
- for line in data_file:
- short_id = line.strip('\n')
- if len(short_id) == 10:
- short_id_list.append(line.strip('\n'))
- else:
- invalid_ids.append(short_id)
- print 'Total of IDs in the file: {}.'.format(
- len(short_id_list) + len(invalid_ids))
- pdb.set_trace()
- print 'InvalidIDs: {}'.format(len(invalid_ids))
- print 'Valid IDs to downlaod: {}'.format(len(short_id_list))
- data_file.close()
- short_id_list = short_id_list
- return short_id_list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement