#r'c:\' #File name: bozzypy.py import string import os import time rtf_dic = file(r'c:\bozzy.rtf','r+') boilerp_head = '''{\\rtf1\\ansi{\\*\\cxrev100}\\cxdict{\\*\\cxsystem Digital CAT 00214 RTF by Stenovations, Inc.}\\deff0{\\fonttbl {\\f0\\fmodern Courier New;}}{\\stylesheet{\\s0 Normal;}{\\s1 Question; }{\\s2 Answer;}{\\s3 Colloquy;}}{\\*\\cxtranopt\\numbar}''' rtf_dic.write(boilerp_head) boilerp_pre = '{\\*\\cxs ' boilerp_post = '{\\*\\cxsvatdictentrydate\\yr2006\\mo12\\da5}' word_list = open(r'c:\wordlist.txt', 'r') for line in word_list: print line steno_entry = raw_input(r'steno:''') if steno_entry == 'quit': break def rtf_convert(): steno_entry = steno_entry.replace(r'] [',r'/') steno_entry = steno_entry.replace(r'[','') steno_entry = steno_entry.replace(r']','') dic_entry = os.path.join(boilerp_pre + steno_entry + r'}' + line + boilerp_post) rtf_dic.write(dic_entry) print print steno_entry + line entry_decide = raw_input(r'next, again, delete:''') if entry_decide == 'next': rtf_convert() elif entry_decide == 'quit': break elif entry_decide == 'again': rtf_convert() print line steno_entry = raw_input(r'steno:''') elif entry_decide == 'delete': print line steno_entry = raw_input(r'steno:''') rtf_dic.close() print 'Done'