Skip to content

Commit

Permalink
Merge pull request #392 from prabhakaryadav2003/doc/corrected-print-s…
Browse files Browse the repository at this point in the history
…tatement
  • Loading branch information
willwade authored Jan 5, 2025
2 parents fb94674 + 02d3067 commit de65c3b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/engine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ Listening for events

import pyttsx3
def onStart(name):
print 'starting', name
print('starting', name)
def onWord(name, location, length):
print 'word', name, location, length
print('word', name, location, length)
def onEnd(name, completed):
print 'finishing', name, completed
print('finishing', name, completed)
engine = pyttsx3.init()
engine.connect('started-utterance', onStart)
engine.connect('started-word', onWord)
Expand All @@ -243,7 +243,7 @@ Interrupting an utterance

import pyttsx3
def onWord(name, location, length):
print 'word', name, location, length
print('word', name, location, length)
if location > 10:
engine.stop()
engine = pyttsx3.init()
Expand Down Expand Up @@ -292,11 +292,11 @@ Running a driver event loop

engine = pyttsx3.init()
def onStart(name):
print 'starting', name
print('starting', name)
def onWord(name, location, length):
print 'word', name, location, length
print('word', name, location, length)
def onEnd(name, completed):
print 'finishing', name, completed
print('finishing', name, completed)
if name == 'fox':
engine.say('What a lazy dog!', 'dog')
elif name == 'dog':
Expand Down

0 comments on commit de65c3b

Please sign in to comment.