summaryrefslogtreecommitdiffstats
path: root/Doc/library/multiprocessing.rst
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2009-09-13 07:54:02 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2009-09-13 07:54:02 (GMT)
commit985e24dcf7368894f945c360c383059a21b1ba0b (patch)
tree4736769c0e526b53c8a98c3dfd213e5bf9c89bb1 /Doc/library/multiprocessing.rst
parentb5845056da831ee3bad9400d5fe9dcd88f9ae534 (diff)
downloadcpython-985e24dcf7368894f945c360c383059a21b1ba0b.zip
cpython-985e24dcf7368894f945c360c383059a21b1ba0b.tar.gz
cpython-985e24dcf7368894f945c360c383059a21b1ba0b.tar.bz2
fixed more examples that were using u"", print without () and unicode/str instead of str/bytes
Diffstat (limited to 'Doc/library/multiprocessing.rst')
-rw-r--r--Doc/library/multiprocessing.rst16
1 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 1898132..314cd2d 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -77,14 +77,14 @@ To show the individual process IDs involved, here is an expanded example::
import os
def info(title):
- print title
- print 'module name:', __name__
- print 'parent process:', os.getppid()
- print 'process id:', os.getpid()
+ print(title)
+ print('module name:', __name__)
+ print('parent process:', os.getppid())
+ print('process id:', os.getpid())
def f(name):
info('function f')
- print 'hello', name
+ print('hello', name)
if __name__ == '__main__':
info('main line')
@@ -279,10 +279,10 @@ For example::
return x*x
if __name__ == '__main__':
- pool = Pool(processes=4) # start 4 worker processes
+ pool = Pool(processes=4) # start 4 worker processes
result = pool.apply_async(f, [10]) # evaluate "f(10)" asynchronously
- print result.get(timeout=1) # prints "100" unless your computer is *very* slow
- print pool.map(f, range(10)) # prints "[0, 1, 4,..., 81]"
+ print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
+ print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]"
Reference