Should I use stackless python or threads?

2009-03-06 Thread Minesh Patel
for the help, Minesh Patel -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I use stackless python or threads?

2009-03-06 Thread Minesh Patel
On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone exar...@divmod.com wrote: On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel min...@gmail.com wrote: I am trying to figure out the best approach to solve this problem: I want to poll various directories(can be run in the main thread). Once I

Concurrent tasklets in Stackless Python

2009-03-09 Thread Minesh Patel
Is there a way for multiple tasklets to run in parallel? I have been following the examples in http://members.verizon.net/olsongt/stackless/why_stackless.html but it seems that tasklets block for data or are scheduled and there is no way to run them concurrently. -- Thanks, Minesh Patel -- http

Re: Concurrent tasklets in Stackless Python

2009-03-09 Thread Minesh Patel
On Mon, Mar 9, 2009 at 3:17 PM, Chris Rebert c...@rebertia.com wrote: On Mon, Mar 9, 2009 at 3:05 PM, Minesh Patel min...@gmail.com wrote: Is there a way for multiple tasklets to run in parallel? Seems doubtful (though I'm not an expert). From the Wikipedia article: Stackless microthreads

Re: parallel/concurrent process in python

2009-03-10 Thread Minesh Patel
(), it is the same as C's fork? if os.fork(): # Returns 0 to child, non-zero to parent # Do parent stuff else: # Do child stuff -- Thanks, Minesh Patel -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel/concurrent process in python

2009-03-10 Thread Minesh Patel
for spawning a shell command, piping, etc... -- Thanks, Minesh Patel -- http://mail.python.org/mailman/listinfo/python-list

Python patch module

2009-02-02 Thread Minesh Patel
Hi, I was wondering if there is any patch management module for Python. Basically I am looking to only apply a hunk from a patch if the file exists. -- Thanks, Minesh -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess hangs on reading stdout

2009-10-14 Thread Minesh Patel
Any ideas? comments on code welcome also. Here's something that I would probably do, there may be better ways. This only works on python2.6 for the terminate() method. import signal import subprocess def timeout_handler(signum, frame): print About to kill process p.terminate() for

Re: How to schedule system calls with Python

2009-10-15 Thread Minesh Patel
Again another great suggestion.  I was not aware of the multiprocessing module, and I'm not (yet) sure if I understand why I should use instead of multithreading as explained by a previous post. http://docs.python.org/library/multiprocessing.html First paragraph... -- Thanks, --Minesh --

Re: Is there is any way to send messages to chunk of emails ID's concurrently using smptlib

2009-05-05 Thread Minesh Patel
On Mon, May 4, 2009 at 2:01 PM, Piet van Oostrum p...@cs.uu.nl wrote: gganesh ganesh@gmail.com (g) wrote: g Hi friends, g I suppose sendmail() can send mails one by one ,how to send mails g concurrently , g It would be very grateful,if someone could point out a solution. You can always use

ConfigParser and newlines

2009-05-15 Thread Minesh Patel
I am using ConfigParser to parse a config file and I want to maintain the newlines, how is it possible. Example given below. BTW, is there an alternative to configParser, should I use 'exec' instead. Is there any support for yaml built-in or possibly in the future? test.cfg

Re: ConfigParser and newlines

2009-05-15 Thread Minesh Patel
Not as best I can tell.  From my /usr/lib/python2.5/ConfigParser.py file, around line 441:  if line[0].isspace() and cursect is not None and optname:    value = line.strip()    if value:      cursect[optname] = %s\n%s % (cursect[optname], value) That value = line.strip() is what's

Re: how to iterate over several lists?

2009-06-05 Thread Minesh Patel
On Fri, Jun 5, 2009 at 10:20 AM, Tomsevenb...@gmail.com wrote: On Fri, 5 Jun 2009 04:07:19 + (UTC), kj no.em...@please.post wrote: Suppose I have two lists, list_a and list_b, and I want to iterate over both as if they were a single list.  E.g. I could write: for x in list_a:    foo(x)