Use python COM to control MS Agent
import sys
from win32com.client import constants
import win32com.client
import time
Agent = win32com.client.Dispatch("Agent.Control.2")
Agent.Connected = 1
Agent.Characters.Load("Merlin",
"C:\WINNT\MSAGENT\CHARS\MERLIN.ACS")
Merlin=Agent.Characters("Merlin")
Merlin.Show()
print "Type word or phrase, then enter."
print "Ctrl+Z then enter (dos/win32) or Ctrl+D (unix) to exit."
while 1:
try:
s = raw_input()
if s=='EXIT': sys.exit()
Merlin.Speak(s)
except:
raise
|