Skip to content

Instantly share code, notes, and snippets.

@slava-sh
Created December 31, 2014 15:35
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 slava-sh/dc36155aeef7f1830f67 to your computer and use it in GitHub Desktop.
Save slava-sh/dc36155aeef7f1830f67 to your computer and use it in GitHub Desktop.
Anki add-on
# -*- coding: utf-8 -*-
import random
from anki.hooks import addHook
def fmod_random(txt, extra, context, tag, fullname):
return random.choice([x.strip() for x in txt.split(',')])
addHook('fmod_random', fmod_random)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment