def main(argv=None):
print (transliterate('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'))<EOL>if argv is None:<EOL><INDENT>argv = sys.argv<EOL><DEDENT>try:    <EOL><INDENT>text, inFormat, outFormat = argv[<NUM_LIT:1>:<NUM_LIT:4>]<EOL><DEDENT>except ValueError:<EOL><INDENT>print (main.__doc__)<EOL>return <NUM_LIT:2><EOL><DEDENT>inFormat = inFormat.upper()<EOL>outFormat = outFormat.upper()<EOL>try:<EOL><INDENT>f = open(text)<EOL><DEDENT>except IOError:<EOL><INDENT>print (transliterate(text, inFormat, outFormat))<EOL>return <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>i = <NUM_LIT:1><EOL>for text in f.readlines():<EOL><INDENT>if len(text) > <NUM_LIT:0> and not text.startswith('<STR_LIT:#>'):<EOL><INDENT>print (transliterate(text, inFormat, outFormat).strip('<STR_LIT:\n>'))<EOL><DEDENT>i = i + <NUM_LIT:1><EOL><DEDENT>f.close()<EOL>return <NUM_LIT:0><EOL><DEDENT>
Call transliterator from a command line.

    python transliterator.py text inputFormat outputFormat

    ... writes the transliterated text to stdout

    text -- the text to be transliterated OR the name of a file containing the text
    inputFormat -- the name of the character block or transliteration scheme that
                   the text is to be transliterated FROM, e.g. 'CYRILLIC', 'IAST'.
                   Not case-sensitive
    outputFormat -- the name of the character block or transliteration scheme that
                   the text is to be transliterated TO, e.g. 'CYRILLIC', 'IAST'.
                   Not case-sensitive