Преглед изворни кода

mapcalc_start() code example

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52219 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman пре 13 година
родитељ
комит
920bb29845
1 измењених фајлова са 7 додато и 8 уклоњено
  1. 7 8
      lib/python/raster.py

+ 7 - 8
lib/python/raster.py

@@ -106,15 +106,14 @@ def mapcalc_start(exp, quiet = False, verbose = False, overwrite = False, **kwar
 
     \code
     >>> expr1 = '"%s" = "%s" * 10' % (output, input)
-    >>> p1 = grass.mapcalc_start(expr1, stdout = subprocess.PIPE)
-    >>> print p1
-    <subprocess.Popen object at 0xb7c12f6c>
-    >>> # start other jobs now ...
-    
-    >>> # collect the results and wait for them to finish:
-    >>> if not p1.stdout.closed:
-    ...     pout1 = p1.communicate()[0]
+    >>> expr2 = '...'   # etc.
+    >>> # launch the jobs:
+    >>> p1 = grass.mapcalc_start(expr1)
+    >>> p2 = grass.mapcalc_start(expr2)   # etc.
+    ...
+    >>> # wait for them to finish:
     >>> p1.wait()
+    >>> p2.wait()   # etc.
     \endcode
 
     (maybe stdout = subprocess.PIPE and p1.stdout.closed can be avoided)