I am trying to start multiple instances using a for statement but this is not working. Has anyone tried affinity module?<br><br>Tax<br><br><div class="gmail_quote">2011/5/17 Emile van Sebille <span dir="ltr"><<a href="mailto:emile@fenx.com">emile@fenx.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On 5/17/2011 7:29 AM tax botsis said...<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Part of my code includes the following script, which both shows a<br>
progress bar (for as long as 'categorize_reports()' is executed) and<br>
prints the fileid and the output of the 'document' function; the latter<br>
is the one increasing the calculation time (please see my comment). Any<br>
ideas on how to use all the cores of my CPU here?<br>
</blockquote>
<br></div>
A python instance lives it life on a single processor. Accessing multiple cores requires you start multiple python instances. You'd need to restructure to provide some form of cooperative independent processing. Pyro, stackless, and twisted come to mind. It looks like<br>
the info at <a href="http://wiki.python.org/moin/ParallelProcessing" target="_blank">http://wiki.python.org/moin/ParallelProcessing</a> is more up to date than my memory...<br>
<br>
Emile<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
...<br>
def categorize_reports():<br>
if __name__ == '__main__':<br>
root2 = Tkinter.Tk(className=' Processing Progress')<br>
m = Meter(root2, relief='ridge', bd=3)<br>
m.pack(fill='x')<br>
i=0.0<br>
for fileid in fileids():<br>
m.set(i, 'Processing will take a few minutes...')<br>
i=i+1.000/len(fileids())<br>
m.after(1000, lambda: _demo(m, i))<br>
print str(fileid), document(fileid) #this slows down the<br>
process<br>
root2.withdraw()<br>
...<br>
<br>
Thanks<br>
Tax<br>
<br>
<br>
<br></div>
_______________________________________________<br>
Tutor maillist - <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote>
<br>
<br>
_______________________________________________<br>
Tutor maillist - <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote></div><br>