<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Speech Recognition and Arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682203#M52828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I think the issue was that there were spaces in the pathname.&amp;nbsp; I've utilized r"pathname" before to account for this, however, it doesn't seem to work with pyspeech.&amp;nbsp; I just tried it with a pathname without spaces and it works.&amp;nbsp; Thank you for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Aug 2015 19:11:19 GMT</pubDate>
    <dc:creator>WinnKetchum</dc:creator>
    <dc:date>2015-08-05T19:11:19Z</dc:date>
    <item>
      <title>Speech Recognition and Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682200#M52825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been doing some python development/scripting, trying to figure out how to complete Arcpy processes with speech recognition.&amp;nbsp; At the moment I'm using pyspeech, which utilizes windows speech recognition, and as a test I'm having it do something simply like copy a set of point features.&amp;nbsp; The script works as a stand-alone python script, however when I try to incorporate it into the pyspeech method, I get the an error that the file I'm trying to copy is not supported or doesn't exist.&amp;nbsp; Which to me is wrong, as it works otherwise.&amp;nbsp; Below are copies of the script, both with and without pyspeech, as well as the error I get when using it with pyspeech.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for any help with this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Winn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;################################&lt;/P&gt;&lt;P&gt;Code without pyspeech:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import os&lt;BR /&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;from datetime import datetime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now = datetime.now()&lt;BR /&gt;Ver_Date = str(now.strftime("%m/%d/%Y"))&lt;BR /&gt;File_Date = str(now.strftime("%m%d%y"))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;workspace = r"C:\Users\ketchum\Documents\Python Projects\Field Work Master\FieldWork.gdb"&lt;BR /&gt;gps_fc = workspace + "&lt;A href="https://community.esri.com/"&gt;\\GPSLog&lt;/A&gt;_" + File_Date&lt;BR /&gt;note_fc = workspace + "&lt;A href="https://community.esri.com/"&gt;\\Notes&lt;/A&gt;_" + File_Date&lt;BR /&gt;note_fc2 = workspace + "&lt;A href="https://community.esri.com/"&gt;\\Notes&lt;/A&gt;_" + File_Date + "_Copy"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.AddMessage('Copying notes.')&lt;BR /&gt;arcpy.Copy_management(note_fc, note_fc2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;############################&lt;/P&gt;&lt;P&gt;Code with pyspeech:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import speech&lt;BR /&gt;import arcpy&lt;BR /&gt;from datetime import datetime&lt;BR /&gt;import time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now = datetime.now()&lt;BR /&gt;Ver_Date = str(now.strftime("%m/%d/%Y"))&lt;BR /&gt;File_Date = str(now.strftime("%m%d%y"))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;workspace = r"C:\Users\ketchum\Documents\Python Projects\Field Work Master\FieldWork.gdb"&lt;/P&gt;&lt;P&gt;gps_fc = workspace + "&lt;A href="https://community.esri.com/"&gt;\\GPSLog&lt;/A&gt;_" + File_Date&lt;BR /&gt;note_fc = workspace + "&lt;A href="https://community.esri.com/"&gt;\\Notes&lt;/A&gt;_" + File_Date&lt;BR /&gt;note_fc2 = workspace + "&lt;A href="https://community.esri.com/"&gt;\\Notes&lt;/A&gt;_" + File_Date + "_Copy"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;speech.say('Ready for your instruction.')&lt;/P&gt;&lt;P&gt;print File_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def L1Callback(phrase, listener):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speech.say(phrase)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if phrase == "notes":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage('Copying notes.')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Copy_management(note_fc, note_fc2)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; speech.say('Notes have been copied.')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if phrase == "goodbye":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listener.stoplistening()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;L1 = speech.listenforanything(L1Callback)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while L1.islistening():&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(1) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#######################################################&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Error when using AddNote_pyspeech.py:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;072215&lt;/P&gt;&lt;P&gt;Copying notes.&lt;/P&gt;&lt;P&gt;pythoncom error: Python error invoking COM method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python26\ArcGIS10.0\lib\site-packages\win32com\server\policy.py", line 277, in _Invoke_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self._invoke_(dispid, lcid, wFlags, args)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python26\ArcGIS10.0\lib\site-packages\win32com\server\policy.py", line 282, in _invoke_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python26\ArcGIS10.0\lib\site-packages\win32com\server\policy.py", line 585, in _invokeex_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return func(*args)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python26\ArcGIS10.0\lib\site-packages\speech.py", line 135, in OnRecognition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self._callback(phrase, self._listener)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Users\ketchum\Documents\Python Projects\Voice Recognition\AddNote_pyspeech.py", line 35, in L1Callback&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Copy_management(note_fc, note_fc2)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 3010, in Copy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/P&gt;&lt;P&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/P&gt;&lt;P&gt;ERROR 000732: Input Data Element: Dataset C:\Users\ketchum\Documents\Python Proj&lt;/P&gt;&lt;P&gt;ects\Field Work Master\FieldWork.gdb\Notes_072215 does not exist or is not supported&lt;/P&gt;&lt;P&gt;Failed to execute (Copy).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 21:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682200#M52825</guid>
      <dc:creator>WinnKetchum</dc:creator>
      <dc:date>2015-07-22T21:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Speech Recognition and Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682201#M52826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a question... how is the raw syntax and spaces handled by the language program ??&amp;nbsp; (ie r"c:\yourpath\yourfile.yourextension"&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 22:07:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682201#M52826</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-07-22T22:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Speech Recognition and Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682202#M52827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you use, and do you get the same error with &lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/copy-features.htm"&gt;CopyFeatures_management&lt;/A&gt; rather than &lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/copy.htm"&gt;Copy_management&lt;/A&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 22:27:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682202#M52827</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-07-22T22:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Speech Recognition and Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682203#M52828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I think the issue was that there were spaces in the pathname.&amp;nbsp; I've utilized r"pathname" before to account for this, however, it doesn't seem to work with pyspeech.&amp;nbsp; I just tried it with a pathname without spaces and it works.&amp;nbsp; Thank you for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 19:11:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682203#M52828</guid>
      <dc:creator>WinnKetchum</dc:creator>
      <dc:date>2015-08-05T19:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Speech Recognition and Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682204#M52829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get the same error with CopyFeatures as I do with Copy.&amp;nbsp; It seems it was the pathname itself that was causing the issue.&amp;nbsp; Thank you for your suggestion though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 19:14:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/speech-recognition-and-arcpy/m-p/682204#M52829</guid>
      <dc:creator>WinnKetchum</dc:creator>
      <dc:date>2015-08-05T19:14:36Z</dc:date>
    </item>
  </channel>
</rss>

