Skip to content

Instantly share code, notes, and snippets.

@danielpyon
Created April 14, 2023 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpyon/317401350b63ff239d6c22f46cca8a76 to your computer and use it in GitHub Desktop.
Save danielpyon/317401350b63ff239d6c22f46cca8a76 to your computer and use it in GitHub Desktop.
message of the day
import os
import random
x=list(map(lambda x: x[:-4], os.listdir('/usr/share/cowsay/cows/')))
cf=x[random.randint(0,len(x)-1)]
c='cowsay' if random.random() < 0.5 else 'cowthink'
os.system(f'fortune -a | {c} -f {cf}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment