Created
November 19, 2016 03:33
-
-
Save zyouyowa/b433e589794119c2d5f0197e5be36938 to your computer and use it in GitHub Desktop.
"。うせどdのろのかばyとも"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf_8 -*- | |
import sys | |
import subprocess | |
import pykakasi | |
def romaji(txt): | |
"Japanese->Romaji" | |
kks = pykakasi.kakasi() | |
kks.setMode('H', 'a') | |
kks.setMode('K', 'a') | |
kks.setMode('J', 'a') | |
conv = kks.getConverter() | |
return conv.do(txt) | |
def say(txt): | |
"use say command" | |
subprocess.call('say "{}"'.format(txt), shell=True) | |
if __name__ == '__main__': | |
rev = romaji(sys.argv[1])[::-1] | |
say(rev) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment