<?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: Passing objects into (and out of) a subprocess (Python) in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442793#M14865</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh a pickle is a good idea. I wasnt thinking of serialization=pickles. Mental jam I guess. That would work easily actually &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris, I use subprocess.Popen() not os.popen. Subprocess is meant for opening a process and os really isnt. This is a task manager I wrote for our server (once we go to 10 I will be able to do it all from python2.6, but notice some needs to be launced by 2.5). The first script to run has a clause in it of sys.exit(0) if something dowesnt quality and returns a 0 value to .wait() when that script closes. You can use this to make your code continue after the subprocess runs. You can use .communicate instead of .wait to read out the stdout from the child if you need to know where in the other script you are. Oh and yes spawn is going away according to &lt;/SPAN&gt;&lt;A href="http://docs.python.org/release/2.6.6/library/subprocess.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://docs.python.org/release/2.6.6/library/subprocess.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
from time import localtime
from subprocess import Popen
 
result=Popen([r'C:\Python26\python.exe', r'C:\GIS Projects\CRW\FTPhalf.py']).wait()
if result == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; Popen([r'C:\Python25\python.exe', r'C:\GIS Projects\CRW\GPhalf1.1.py']).wait()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Popen([r'C:\Python25\python.exe', r'C:\GIS Projects\TaxChange\taxchange.py']).wait()
 
if localtime()[2] == 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp; subprocess.Popen([r'C:\Python25\python.exe', r'C:\GIS Projects\GIS Projects\Parcels.gdb\parcelupdate.py']).wait()
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your script could include:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
result=subprocess.Popen('([r'C:\Python25\python.exe', your script]').wait() #in the other script, at the end make it do sys.exit(1) if you compelete successfully
if result==1:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print error info here
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:48:09 GMT</pubDate>
    <dc:creator>ChrisMathers</dc:creator>
    <dc:date>2021-12-11T19:48:09Z</dc:date>
    <item>
      <title>Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442788#M14860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is essentially a repeat of Chris Snyder's 2006 post on the old forum (&lt;/SPAN&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1729&amp;amp;t=193431&amp;amp;mc=0#msgid575153"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1729&amp;amp;t=193431&amp;amp;mc=0#msgid575153&lt;/A&gt;&lt;SPAN&gt;). It didn't get any replies back then; I'm hoping for better luck &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have any examples of using the subprocess module to pass objects into a slave script and then get the results back to the parent script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've seen some examples which pass file paths (as strings) into the slave script, but I really need to have the slave script manipulate numpy arrays declared in the parent script, then pass the results back out again (again as numpy arrays). Is this possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 10:52:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442788#M14860</guid>
      <dc:creator>jamessample</dc:creator>
      <dc:date>2010-11-10T10:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442789#M14861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should ask this on #python on irc.freenode.net. Thats where I take most of my pure python questions. Sharp bunch of folks there. Not that we are dull &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I asked in #python since I already had the chat open. Afrer reading your post they said:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; &lt;BR /&gt;You need some sort of serialization model to pass information among processes. They can't just manipulate the same memory. There's a chance James wants multiprocessing, twisted, numpy's serialization stuff, or a few other things.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That stuff is beyond me, but they seem to know about it there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 12:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442789#M14861</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-11-10T12:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442790#M14862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fantastic - thanks Chris!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect that this is well beyond me too, but it's nice to know that it's possible if you know what you're doing. I'll do some research on "serialization models" and see how far I get.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for pointing out #python on irc.freenode.net too - looks very useful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 14:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442790#M14862</guid>
      <dc:creator>jamessample</dc:creator>
      <dc:date>2010-11-10T14:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442791#M14863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Regarding serialization, they are likely referring to using pickle or marshall to save the numpy object to a file. The two scripts below show how this works. &lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;The parent.py script creates a simply numpy array and "pickles" (serializes) it to a file. &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The file path is passed to the child script to start a subprocess. &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The child script "unpickles" (de-serializes) the array, modifies it, then re-pickles it. &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The parent script unpickles the modified array and prints the result.&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# parent.py

import numpy, pickle, os, subprocess, sys

colArray = numpy.array([1,2,3])
strOutputFile = os.path.join(os.getenv('TEMP'), "array.pkl")
pickle.dump(colArray, open(strOutputFile, 'wb'))

print colArray

strChildScript = r"C:\Temp\child.py"
intReturnCode = subprocess.call([os.path.join(sys.prefix, "python.exe"), strChildScript, strOutputFile])

colNewArray = pickle.load(open(strOutputFile, 'rb'))

print colNewArray&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# child.py

import numpy, pickle, sys

strOutputFile = sys.argv[1]
colArray = pickle.load(open(strOutputFile, 'rb'))

colArray2 = numpy.array([4,5,6])
colArray = numpy.vstack((colArray, colArray2))

pickle.dump(colArray, open(strOutputFile, 'wb'))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:48:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442791#M14863</guid>
      <dc:creator>BradPosthumus</dc:creator>
      <dc:date>2021-12-11T19:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442792#M14864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Curious, but if you find a good method for doing this can you post it here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have struggled with finding a replacement for the 'os.P_NOWAIT' option of the os.spawnv method. I use os.P_NOWAIT (instead of os.P_WAIT) to launch multiple instances of slave scripts (that run in python.exe) to, in effect, create a pseudo method of parallel processing. Not being a "real" programmer, I simply rely on the child process writing out messages in a .txt file, and then have set up the master script/process to look for and read the message .txt file evry 10 seconds or so. Anyway, I'd love to update my stuff to use the subprocess module, but really haven't ever found any examples - specifically of launching a subprocess&amp;nbsp; (or many subprocesses) and having the master script not "wait" (e.g. sit there like a dummy) until the subprocess finished. I guess my os.spwanv system works pretty well for me, so I was kinda apathetic about putting to much time into finding a newer replacement. I'd imagine that os.spwanv will not be supported in Python 3.x...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 16:57:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442792#M14864</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-10T16:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442793#M14865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh a pickle is a good idea. I wasnt thinking of serialization=pickles. Mental jam I guess. That would work easily actually &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris, I use subprocess.Popen() not os.popen. Subprocess is meant for opening a process and os really isnt. This is a task manager I wrote for our server (once we go to 10 I will be able to do it all from python2.6, but notice some needs to be launced by 2.5). The first script to run has a clause in it of sys.exit(0) if something dowesnt quality and returns a 0 value to .wait() when that script closes. You can use this to make your code continue after the subprocess runs. You can use .communicate instead of .wait to read out the stdout from the child if you need to know where in the other script you are. Oh and yes spawn is going away according to &lt;/SPAN&gt;&lt;A href="http://docs.python.org/release/2.6.6/library/subprocess.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://docs.python.org/release/2.6.6/library/subprocess.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
from time import localtime
from subprocess import Popen
 
result=Popen([r'C:\Python26\python.exe', r'C:\GIS Projects\CRW\FTPhalf.py']).wait()
if result == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; Popen([r'C:\Python25\python.exe', r'C:\GIS Projects\CRW\GPhalf1.1.py']).wait()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Popen([r'C:\Python25\python.exe', r'C:\GIS Projects\TaxChange\taxchange.py']).wait()
 
if localtime()[2] == 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp; subprocess.Popen([r'C:\Python25\python.exe', r'C:\GIS Projects\GIS Projects\Parcels.gdb\parcelupdate.py']).wait()
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your script could include:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
result=subprocess.Popen('([r'C:\Python25\python.exe', your script]').wait() #in the other script, at the end make it do sys.exit(1) if you compelete successfully
if result==1:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print error info here
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:48:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442793#M14865</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2021-12-11T19:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442794#M14866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To prevent the parent script from waiting for the child script (i.e. os.P_NOWAIT), use subprocess.Popen instead of subprocess.call:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;subprocess.Popen([os.path.join(sys.prefix, "python.exe"), strChildScript, strOutputFile])&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In fact, if you try this in the code above you'll find it re-reads the array before the child process can finish altering it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;pid = subprocess.Popen([os.path.join(sys.prefix, "python.exe"), strChildScript, strOutputFile]).pid&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...you get the process ID that can be used to track the process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However it looks like os.spawnv is still part of Python 3.x, so if it's not broke....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In Python 2.6 there's also a new multiprocessing module that may be worth looking into, but I haven't tested it yet since I'm still mired in ArcGIS 9.3 with Python 2.5.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 17:25:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442794#M14866</guid>
      <dc:creator>BradPosthumus</dc:creator>
      <dc:date>2010-11-10T17:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442795#M14867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Very nice - Thanks Chris and Brad!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 18:30:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442795#M14867</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-10T18:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442796#M14868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think you might do well by switching your NumPy array to use &lt;/SPAN&gt;&lt;A href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.memmap.html"&gt;memmaps&lt;/A&gt;&lt;SPAN&gt; -- this minimizes the amount of IPC you're going to need to do and on Linux and Windows a memory-mapped file tends to be quite a bit more efficient than manually crafted sequential I/O with serialization/deserialization across the pipe.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 06:30:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442796#M14868</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2010-11-11T06:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442797#M14869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You guys are great - thanks to all! It's going to take a while for me to absorb all of the good info on this thread.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using 'pickle' looks like a good option, and Brad's code snippet illustrating its use is very helpful. numpy.memmap sounds interesting too, but I'll have to go away and do some reading to decide if it's within my current (fairly meagre) coding abilities. Either way I reckon you've solved my problem &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In reply to Chris S: It looks like Brad and Chris M have answered your question about os.P_NOWAIT better than I ever could. If I do find anything else, I'll be sure to post back here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 09:04:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442797#M14869</guid>
      <dc:creator>jamessample</dc:creator>
      <dc:date>2010-11-11T09:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Passing objects into (and out of) a subprocess (Python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442798#M14870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If anyone is interested - here's an update of my os.spwanv psudo-parallel process method but now ***new and improved***using the subprocess module and better/fancier coding methods. It doesn't include any robust method (other than simple strings and return codes) of comunicating between parent and child processes but it could be altered to do that using the provided subprocess.Popen object (I guess via the .stdin method?). I'd be super happy to have someone smart show me how to elaborate on my simple example to include fancy stuff like handing numpy arrays to the child process or sending dictionary objects back to the parent script - something fancy like that! I am not there yet, but will probably have the need to do this eventually. For now it's a first stab and accomplishes what I need it to do...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the link: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/33602-Arcpy-Multiprocessor-issues?p=177418&amp;amp;viewfull=1#post177418"&gt;http://forums.arcgis.com/threads/33602-Arcpy-Multiprocessor-issues?p=177418&amp;amp;viewfull=1#post177418&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 23:48:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/passing-objects-into-and-out-of-a-subprocess/m-p/442798#M14870</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-03-01T23:48:39Z</dc:date>
    </item>
  </channel>
</rss>

