<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.python.general">
    <title>gmane.comp.python.general</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657344"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657343"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657342"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657341"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657340"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657339"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657338"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657337"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657336"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657335"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657334"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657333"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657332"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657331"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657330"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657329"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657328"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657327"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657326"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/657325"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657344">
    <title>Re: pivot() equivalent</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657344</link>
    <description>&lt;pre&gt;
Try this:

 &amp;gt; type lines.txt
the
quick
brown
fox
jumps
over
the
lazy
dog

 &amp;gt; type pivot.py

def pivot(pivot_function, filename):
     a_list = []
     b_list = []
     for line in open(filename):
         target_list = a_list if pivot_function(line) else b_list
         target_list.append(line[:-1])
     return (a_list, b_list)

print pivot(lambda line: 'e' in line, "lines.txt")

 &amp;gt; python pivot.py
(['the', 'over', 'the'], ['quick', 'brown', 'fox', 'jumps', 'lazy', 'dog'])

-John
&lt;/pre&gt;</description>
    <dc:creator>John Posner</dc:creator>
    <dc:date>2010-03-11T23:39:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657343">
    <title>Re: Bluetooth</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657343</link>
    <description>&lt;pre&gt;&lt;/pre&gt;</description>
    <dc:creator>PythonAB</dc:creator>
    <dc:date>2010-03-11T23:29:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657342">
    <title>Re: inspect.stack() and frame</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657342</link>
    <description>&lt;pre&gt;* Félix-Antoine Fortin:

hex returns a string. applying str is therefore redundant.



You're dealing with Python objects. You're not dealing with the computer's 
machine stack. Whether you get the same id for two objects whose lifetimes don't 
overlap depends on the implementation's memory and id allocation strategy.



Does it?


Cheers,

- Alf
&lt;/pre&gt;</description>
    <dc:creator>Alf P. Steinbach</dc:creator>
    <dc:date>2010-03-11T23:22:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657341">
    <title>Re: Parsing Email Headers</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657341</link>
    <description>&lt;pre&gt;Thanks for your suggestions!  Here's what seems to be working - it's
basically the same thing I originally had, but first checks to see if
the line is blank

                response, lines, bytes = M.retr(i+1)
                # For each line in message
                for line in lines:
                    if not line.strip():
                        M.dele(i+1)
                        break

                    emailMessage = email.message_from_string(line)
                    # Get fields
                    fields = emailMessage.keys()
                    # If email contains "From" field
                    if emailMessage.has_key("From"):
                        # Get contents of From field
                        from_field = emailMessage.__getitem__("From")
&lt;/pre&gt;</description>
    <dc:creator>T</dc:creator>
    <dc:date>2010-03-11T23:19:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657340">
    <title>pivot() equivalent</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657340</link>
    <description>&lt;pre&gt;I *know* this already exists, but I can't remember where:

def pivot(func, seq):
  # I know, a good implementation shouldn't call func() twice per item
  return ( (x for x in seq if func(x)), (x for x in seq if not
func(x)) )

I feel like I read a thread in which this was argued to death, and I
can't find that either.

The scenario: I have a sequence of lines from a file.  I want to split
it into those lines that contain a substring, and those that don't.  I
want it to be more efficient and prettier than

with = [x for x in lines if substring in x]
without = [x for x in lines if substring not in x]

Does this exist?

TIA,
Michael
&lt;/pre&gt;</description>
    <dc:creator>gundlach</dc:creator>
    <dc:date>2010-03-11T23:16:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657339">
    <title>Re: Platform Requirement Checker (was Does this already exists?:A modulethat checks if the used platform is supported)</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657339</link>
    <description>&lt;pre&gt;It might be useful for up-front checking in those platform-specific
scripts, although the platform module might already be fulfilling that
need.
&lt;/pre&gt;</description>
    <dc:creator>MRAB</dc:creator>
    <dc:date>2010-03-11T23:09:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657338">
    <title>Re: Parsing Email Headers</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657338</link>
    <description>&lt;pre&gt;
The documentation does say:

   """unfortunately, TOP is poorly specified in the RFCs and is
frequently broken in off-brand servers."""

All I can say is that it works for me with my ISP! :-)
&lt;/pre&gt;</description>
    <dc:creator>MRAB</dc:creator>
    <dc:date>2010-03-11T23:06:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657337">
    <title>inspect.stack() and frame</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657337</link>
    <description>&lt;pre&gt;Given this code :
# Experience with frame
import sys
import inspect

def foo():
    stack = inspect.stack()
    print "foo frame : " + str(hex(id(sys._getframe())))

def foo2():
    inspect.stack()
    print "foo2 frame : " + str(hex(id(sys._getframe())))

def bar():
    print "bar frame : " + str(hex(id(sys._getframe())))

foo()
foo()

foo2()
foo2()

bar()
bar()

Output example :
foo frame : 0x84d2c0
foo frame : 0x844bf0
foo2 frame : 0x898c90
foo2 frame : 0x898c90
bar frame : 0x898f70
bar frame : 0x898f70

Why are the ids (address) of the frame for each foo call not the same?
Or why the call to "stack = inspect.stack()" change the address of the
frame?
&lt;/pre&gt;</description>
    <dc:creator>Félix-Antoine Fortin</dc:creator>
    <dc:date>2010-03-11T23:05:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657336">
    <title>Re: file seek is slow</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657336</link>
    <description>&lt;pre&gt;I just tried the seek test with Cython.
Cython fseek() : 1.059 seconds.  30% slower than 'C'
Python f.seek  : 1.458 secondds. 80% slower than 'C'.

It is amazing to me that Cython generates a 'C' file that is 1478
lines.


#Cython code

import time

cdef int SEEK_SET = 0

cdef extern from "stdio.h":
    void* fopen(char* filename, char* mode)
    int fseek(void*, long, int)

def main():
    cdef void* f1 = fopen('video.txt', 'rb')
    cdef int i=1000000
    t0 = time.clock()
    while i &amp;gt; 0:
       fseek(f1, 0, SEEK_SET)
       i -= 1
    delta = time.clock() - t0
    print "%.3f" % delta

if __name__ == '__main__':
    main()
&lt;/pre&gt;</description>
    <dc:creator>Metalone</dc:creator>
    <dc:date>2010-03-11T22:57:28</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657335">
    <title>Re: Where can I find documentation for data[:,9]</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657335</link>
    <description>&lt;pre&gt;
"Martin P. Hellwig" &amp;lt;martin.hellwig&amp;lt; at &amp;gt;dcuktec.org&amp;gt; wrote in message 
news:hnbq8q$vgm$1&amp;lt; at &amp;gt;news.eternal-september.org...

Thanks a lot, I'll look that up now. 


&lt;/pre&gt;</description>
    <dc:creator> Cal Who</dc:creator>
    <dc:date>2010-03-11T22:52:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657334">
    <title>Platform Requirement Checker (was Does this already exists?: A modulethat checks if the used platform is supported)</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657334</link>
    <description>&lt;pre&gt;Thanks for the reminder, it indeed slipped my mind.

As Python features are luckily mostly platform independent, I am not 
sure if a convenient 'platform requirement check' module would be worth 
the energy creating it, any thoughts on that?

For clarity purpose I re'added (and adapted) in what lines I was thinking:
-
test = RequirePlatform(do_not_raise=True)
# If do_not_raise is not set or False, an error will be raised
# after a failed require line, otherwise just continue.

test.require(key='test1', platform='freebsd', version_min='2.2')
# If the platform is anything else but FreeBSD 2.2 onwards return False
# and store the result of the test.
# Result of the require (and any additional tests
# can be accessed using the index operators;

if test['test1']:
     print('supported')
-
Other requirements like architecture, python vm type/version, cpu 
features, etc. Might also be nice to have.


&lt;/pre&gt;</description>
    <dc:creator>Martin P. Hellwig</dc:creator>
    <dc:date>2010-03-11T22:46:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657333">
    <title>Re: Parsing Email Headers</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657333</link>
    <description>&lt;pre&gt;
I'm still having the same issue, even with .top.  Am I missing
something?

                for j in M.top(i+1, 0)[1]:
                    emailMessage = email.message_from_string(j)
                    #emailMessage =
email.Parser.HeaderParser().parsestr(j, headersonly=True)
                    # Get fields
                    fields = emailMessage.keys()
                    # If email contains "From" field
                    if emailMessage.has_key("From"):
                        # Get contents of From field
                        from_field = emailMessage.__getitem__("From")

Is there another way I should be using to retrieve only the headers
(not those in the body)?
&lt;/pre&gt;</description>
    <dc:creator>T</dc:creator>
    <dc:date>2010-03-11T22:44:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657332">
    <title>Re: Where can I find documentation for data[:,9]</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657332</link>
    <description>&lt;pre&gt;&amp;lt;cut&amp;gt;
Probably for you the right way would be to familiarize yourself with the 
namespace concept of Python, this makes it easier to identify whether 
something is built-in, a standard module or an external module.
Which makes it much easier to feed google the right clues.

&lt;/pre&gt;</description>
    <dc:creator>Martin P. Hellwig</dc:creator>
    <dc:date>2010-03-11T22:19:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657331">
    <title>Re: Where can I find documentation for data[:,9]</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657331</link>
    <description>&lt;pre&gt;
"Robert Kern" &amp;lt;robert.kern&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote in message 
news:mailman.631.1268335358.23598.python-list&amp;lt; at &amp;gt;python.org...
Thanks, that helped a lot.

I'm having trouble knowing what to search for to find documenatation. For 
example, is print a Python command, a numpy command or a java command?

I like to read the documentation even if the command is working for me.


Thanks again 


&lt;/pre&gt;</description>
    <dc:creator> Cal Who</dc:creator>
    <dc:date>2010-03-11T22:08:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657330">
    <title>Re: Reverse engineering CRC?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657330</link>
    <description>&lt;pre&gt;

I'm actually making good progress on this -- it turns out
there *is* a way of deducing the polynomial by looking at
the effect of single-bit flips. It's actually quite simple,
with no brute-force searching needed at all.

Things get a bit tricky when you don't quite know all
of the data that goes into the CRC, though, which seems
to be the case here...

I'm writing up an essay on my experiences. I'll post a
link when it's finished.

&lt;/pre&gt;</description>
    <dc:creator>Gregory Ewing</dc:creator>
    <dc:date>2010-03-11T21:40:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657329">
    <title>Re: Python, Reportlabs, Pil and Windows 7 (64bit)</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657329</link>
    <description>&lt;pre&gt;&amp;lt; at &amp;gt;Robin
Thanks. I thought that this seemed to be a general python thing
because it was effecting both installs. However, after also reading
Martin's comments ...

&amp;lt; at &amp;gt;Martin


Sorry. I have Windows 7 (64-bit) installed on a machine with an AMD
cpu (which supports 64-bit mode), with a 64-bit version of
(Activestate) python 2.6 .... although I didn't realise the later
until I looked just now.

Well, I uninstalled the 64-bit version and the installers did indeed
work.

I’m sorry everyone. I didn’t realise I had installed the 64-bit
version of Python. Well, at least someone else might find have the
same problem. But I think that there is going to be a bit of a rough
patch as everyone moves over to 64-bit.

ALJ
&lt;/pre&gt;</description>
    <dc:creator>Astley Le Jasper</dc:creator>
    <dc:date>2010-03-11T20:57:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657328">
    <title>Re: Parsing Email Headers</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657328</link>
    <description>&lt;pre&gt;
The headers are saparated from the body by a blank line.


Then stop when you see a blank line.

Or retreive just the headers.

&lt;/pre&gt;</description>
    <dc:creator>Grant Edwards</dc:creator>
    <dc:date>2010-03-11T20:20:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657327">
    <title>Re: Visual Python programming and decompilers?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657327</link>
    <description>&lt;pre&gt;Although not as low level as you want,
http://mientki.ruhosting.nl/data_www/pylab_works/pw_animations_screenshots.html
http://code.google.com/p/pylab-works/
and here an overview of similar packages

cheers,
Stef
&lt;/pre&gt;</description>
    <dc:creator>Stef Mientki</dc:creator>
    <dc:date>2010-03-11T20:17:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657326">
    <title>Re: Visual Python programming and decompilers?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657326</link>
    <description>&lt;pre&gt;
Maybe something like http://www.pypes.org/?

They were at pycon and sounded pretty into what they were
talking about- I'd send them an email.

Geremy Condra
&lt;/pre&gt;</description>
    <dc:creator>geremy condra</dc:creator>
    <dc:date>2010-03-11T20:16:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657325">
    <title>Re: Parsing Email Headers</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657325</link>
    <description>&lt;pre&gt;
If you're using poplib then use ".top" instead of ".retr".
&lt;/pre&gt;</description>
    <dc:creator>MRAB</dc:creator>
    <dc:date>2010-03-11T20:13:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/657324">
    <title>Re: importing modules from subdirs</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/657324</link>
    <description>&lt;pre&gt;Halfway there. It imports now, but it says that the module does not
have functions which I know it does have. I will just leave it all in
one folder for now and play with organization after I get the project
working better.

On 3/11/10, Steve Holden &amp;lt;steve&amp;lt; at &amp;gt;holdenweb.com&amp;gt; wrote:


&lt;/pre&gt;</description>
    <dc:creator>Alex Hall</dc:creator>
    <dc:date>2010-03-11T19:56:12</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.python.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.python.general</link>
  </textinput>
</rdf:RDF>
