{"id":2087,"date":"2019-06-01T19:53:13","date_gmt":"2019-06-01T17:53:13","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=2087"},"modified":"2019-06-01T19:53:13","modified_gmt":"2019-06-01T17:53:13","slug":"python-3-7-install-win32com-modules-and-make-pc-talk","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/python-3-7-install-win32com-modules-and-make-pc-talk\/","title":{"rendered":"Python 3.7: install win32com modules and make pc talk"},"content":{"rendered":"<p>We can make the pc talk on window with a code like the one below, using the win32com module.<\/p>\n<pre class=\"lang:default decode:true \">import sys\r\nfrom win32com.client import constants\r\nimport win32com.client\r\n\r\nspeaker = win32com.client.Dispatch(\"SAPI.SpVoice\")\r\nprint (\"Type word or phrase, then enter.\")\r\nprint (\"Ctrl+Z then enter to exit.\")\r\nwhile 1:\r\n   try:\r\n      s = input()\r\n      speaker.Speak(s)\r\n   except:\r\n         sys.exit()<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"Python 3.7 - Install win32com modules and make the Window pc talk\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/xj8u15bx9R8?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"Win32com module to make the pc talk on windows. The code and the video are in this post.\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/python-3-7-install-win32com-modules-and-make-pc-talk\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":2088,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[55],"class_list":["post-2087","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-examples","tag-win32com"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=2087"}],"version-history":[{"count":1,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2087\/revisions"}],"predecessor-version":[{"id":2089,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2087\/revisions\/2089"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/2088"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=2087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=2087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=2087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}