import random, string email_list = "a@b.com, c@d.com".split(', ') random.shuffle(email_list) print string.join(email_list, ', ')