Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot run any multiprocessing script in PythonWin
    primarykey
    data
    text
    <p>I have updated this question to show my problem in a multiprocessing script that doesn't run from PythonWin (by pressing F5), but runs from command prompt. My script:-</p> <pre><code>""" File Name: simple multiprocess example.py Description: A very basic multiprocessing script to show the use of daemon. There are two processes:- p1 - calls listen() and runs in the background (daemon = True) p2 - calls write() """ import multiprocessing import time import sys def listen(): p = multiprocessing.current_process() p_name = str(p.name) pid = str(p.pid) while 1: print "%s process with PID %s running: %s" % (p_name, pid, time.asctime()) time.sleep(1) print 'Exiting :', p.name, p.pid def write(): p = multiprocessing.current_process() p_name = str(p.name) pid = str(p.pid) for x in xrange(3): print "%s process with PID %s running: %s" % (p_name, pid, time.asctime()) time.sleep(1) print 'Exiting :', p.name, p.pid if __name__ == '__main__': p1 = multiprocessing.Process(name='listen', target=listen) p1.daemon = True p2 = multiprocessing.Process(name='write', target=write) p2.daemon = False p1.start() p2.start() time.sleep(7) </code></pre> <p>When I run the above script from PythonWin (by pressing F5), a popup message comes up (with title "Python for Win32") saying "Could not load the file from -c" where is my file name with full path.</p> <p>When I run the same script from command prompt, it seems to run perfectly without any trouble. I get the following output when I run it from command prompt:-</p> <pre><code>s&gt;"simple multiprocess example.py" listen process with PID 4564 running: Tue Jan 04 09:32:49 2011 write process with PID 3744 running: Tue Jan 04 09:32:49 2011 listen process with PID 4564 running: Tue Jan 04 09:32:50 2011 write process with PID 3744 running: Tue Jan 04 09:32:50 2011 listen process with PID 4564 running: Tue Jan 04 09:32:51 2011 write process with PID 3744 running: Tue Jan 04 09:32:51 2011 listen process with PID 4564 running: Tue Jan 04 09:32:52 2011 Exiting : write 3744 listen process with PID 4564 running: Tue Jan 04 09:32:53 2011 listen process with PID 4564 running: Tue Jan 04 09:32:54 2011 listen process with PID 4564 running: Tue Jan 04 09:32:55 2011 </code></pre> <p>I couldn't find anything online related to this problem. Thanks for the help!!</p> <p>Amit P.S: I am running it on Windows XP, PythonWin, Python 2.6.4v</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload