Return to site

Python run a constant subprocess in background

broken image

While this information can feel daunting, the truth is that it has the power to make our work more manageable. And, just like a species of snake can also have subspecies, the Python process can have subprocesses. scripts), or is something other than third-party mods or blacklisted tools crashing my toolbox? If importing other scripts is not allowed, is the recommendation to throw all your functions into the toolbox? I was avoiding doing this, as it makes the code unreadable. Published: ApPython has a lot of tasks and activities that happen in the background these tasks are called processes. Are you similarly unable to import other custom modules (i.e. None of my tools do either of these things, but they do import custom modules that I wrote which use only native arcpy and Python mods. Here's the code: instancetuple.popen subprocess.Popen ( 'python',\ os.path.join (config 'scriptsdir',\ 'instancescript.py'),\ stdin subprocess.PIPE,\ stdout subprocess.

broken image

Looking at the sparse documentation, it appears that tools will not function if they call third-party modules, or use tools from a list of specific ArcGIS toolboxes. import subprocess import sys import time def runprocess(command, timeout): print('Before Popen') proc subprocess. After installing and assigning the new 64-bit paths to my PYTHONPATH, I found that all my tools crash immediately without an explanation.

broken image

I know about the potentials using and, etc., but the implementation seems too tedious, and wanted to see if 64-bit background geoprocessing would process these large datasets. I have been experiencing consistent crashes trying to process large datasets (>100,000 features) with my custom python toolbox tools, which I believe to be a memory issue, as smaller datasets run smoothly.

broken image