possible to preserve subprocess.Popen objects for later?

2007-06-21 Thread Ratko
I have doubts that this could even conceptually work but I thought I'd try asking anyway. I don't have a full understanding of how processes and pipes work on the system level... Thanks, Ratko -- http://mail.python.org/mailman/listinfo/python-list

Re: possible to preserve subprocess.Popen objects for later?

2007-06-22 Thread Ratko
its output to it? Thanks, Ratko -- http://mail.python.org/mailman/listinfo/python-list

Re: popen and a long running process in a wx.python application

2007-06-26 Thread Ratko
c, Windows and Linux the same (besides the "ls" command of course) (5) after you read this text you can send it to a TextCtrl or something Hope that helps. Ratko -- http://mail.python.org/mailman/listinfo/python-list

Can a base class know if a method has been overridden?

2007-09-24 Thread Ratko
Hi all, I was wondering if something like this is possible. Can a base class somehow know if a certain method has been overridden by the subclass? I appreciate any ideas. Thanks, Ratko -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Ratko
> If your use case is to make sure a given ('abstract') method has been > overriden, the canonical solution is to raise NotImplementedError in the > base class's implementation I am not really interested in forcing the subclass to implement a method. I am interested in knowing *whether* it did imp

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Ratko
solution works beautifully! Thank you very much. I was aware that not implementing the onKey method in the first place is the simplest solution but it's much cleaner to offer the methods in advance so that the user can see what is possible. Ratko -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Ratko
; as opposed to calling "my_method" directly. The only reason why I wanted to do this is simplicity, clarity and transparency. Thanks though. Bruno's solution does exactly what I was looking for. Ratko -- http://mail.python.org/mailman/listinfo/python-list

properly delete item during "for item in..."

2008-07-17 Thread Ratko
t c++/STL, I had to deal about these issues and was wondering how python does it. Thanks, Ratko -- http://mail.python.org/mailman/listinfo/python-list

Re: properly delete item during "for item in..."

2008-07-17 Thread Ratko
On Jul 17, 9:57 am, mk <[EMAIL PROTECTED]> wrote: > Gary Herron wrote: > > You could remove the object from the list with > > del myList[i] > > if you knew i. HOWEVER, don't do that while looping through the list! > > Changing a list's length will interact badly with the for loop's > > indexing t

Re: properly delete item during "for item in..."

2008-07-17 Thread Ratko
> > For dictionaries we can just iterate over values() or items() as > > opposed to itervalues() or iteritems() since that's technically a copy > > of values or items in the dict, right? > > No! In fact the whole point of iteritems and itervalues and iterkeys is > that they *DO NOT* make copies, s

comparing two IP addresses and the underlying machine

2006-12-11 Thread Ratko Jagodic
r a mix of them), how can I figure whether they belong to the same physical machine or not? Of course, this is trivial if my python program is running the given machine but what if a remote machine is trying to figure this out (but that machine has access to both domains/IPs). Appreciate and ide

Re: comparing two IP addresses and the underlying machine

2006-12-12 Thread Ratko Jagodic
ld work. Thanks for the help. Ratko On 12/12/06, Tim Chase <[EMAIL PROTECTED]> wrote: > I've been trying to figure this one out for some time but > with no success. I have a machine with two network > interfaces, each with their own IP address and it's own > domai

figuring out how much data was sent so far via XML-RPC?

2006-03-06 Thread Ratko Jagodic
) within the standard python library (no extra modules) because I am distributing this to other people. Thanks in advance! Ratko -- http://mail.python.org/mailman/listinfo/python-list

Re: What version of python is running a script

2006-03-07 Thread Ratko Jagodic
import syssys.version yields something like:2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]On 3/7/06, Fernando Rodríguez <[EMAIL PROTECTED]> wrote:Hi, How can my script tell which version of python is running it?Thanks--http://mail.python.org/mailman/listinfo/python-list -- http:/

Re: inserting into a list

2006-03-07 Thread Ratko Jagodic
from the Library Reference:s.insert(i, x) same as s[i:i] = [x] (5)On 3/7/06, John Salerno <[EMAIL PROTECTED] > wrote:Let me apologize in advance for what I'm sure is an achingly simple question, but I just can't find the answer in either of my Python books.I've tried a few tests wit