![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveList index method for complex list item types?
From: <techiepundit@futurepundit.com>
Date: Sat Dec 31 2005 - 02:13:22 CET
I'm a Python newbie who just started learning the language a few weeks
I have a list of sockets that I use for select.select calls like this:
ReadList,WriteList,EventList = select.select(self.SocketList,[],[],3)
In parallel with that list of sockets I want something that is like a
The idea is every time I do
MySocketIndex = self.SocketList.index(MyTargetSocket)
Then do:
MySubList = self.SocketPacketFragmentList[MySocketIndex]
Then
MyPacketFragment = MySubList[1]
But a thought struck me while writing this: Does Python not provide a
There does not appear to be an alternative to lists that has better
For efficiency's sake it seems to me one wants a search function on
Am I wrong in thinking Python doesn't really provide an automated way
Also, ii C++ one can use STL iterators to move thru a list or deque.
In Python maybe the trick is to use
ii = ii + 1
and then somehow pop out of the for loop once one finds a match?
|