Python: Speak a Website

Опубликовано: 14 Июнь 2026
на канале: Python for Idiots from Idiots
39
3

Hi friends! lets go
➟ Speak a Website
➟ What should i build next for you?

using:
💘https://github.com/autokey/autokey
💘https://github.com/espeak-ng/espeak-ng ( https://github.com/espeak-ng/espeak-ng )
"The eSpeak NG is a compact open source software text-to-speech synthesizer for Linux, Windows, Android and other operating systems. It supports more than 100 languages and accents. It is based on the eSpeak engine created by Jonathan Duddington."


🔰 the script

the script below use curly braces. That's wrong, but YouTube don't allow others. This a dirty quick fix You can use < or > . Please correct that later.

import re, subprocess, os.path, time
def espeakThis(m):
espeak = 'pkill espeak; espeak -vEN "' + m + '"'
p2 = subprocess.Popen(espeak, shell=True)
keyboard.send_keys('<ctrl>+a')
keyboard.send_keys('<ctrl>+c')
time.sleep(.1)
c = clipboard.get_clipboard()
espeakThis(c)

By the way i used Ctrl+C as hotkey and was reading only the content of the clipboard by catched by this.

🔰 the script 2
import re, subprocess, os.path, time
def espeakThis(m):
espeak = 'pkill espeak; espeak -vEN "' + m + '"'
p2 = subprocess.Popen(espeak, shell=True)
keyboard.send_keys('<ctrl>+c')
time.sleep(.1)
c = clipboard.get_clipboard()
espeakThis(c)


#PythonIdiots
#PythonForIdiots
   / @pythonforidiots  

a Coffee ❤️ https://ko-fi.com/pythonforidiots If you enjoy my Videos, please consider supporting what I do. Thank you.