An Automator workflow for generating random integers with Python 2.7

This workflow generates 10 random integers between 1 and 100 and sends them to the pasteboard.

Script

Uses list comprehension:

import random, subprocess

utf8 = {'LANG': 'en_US.UTF-8'}
pipe = subprocess.PIPE
proc = subprocess.Popen('pbcopy', env=utf8, stdin=pipe)
randints = [str(random.randint(1,100)) for _ in range(10)]
proc.communicate(', '.join(randints).encode())