[ANN] Leipzig Python User Group - Meeting, September 27, 2011, 08:00pm

2011-09-26 Thread Mike Müller
=== Leipzig Python User Group === We will meet on Tuesday, September 27 at 8:00 pm at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Mike Müller will talk about the use of the HDF5 format in Python. Everybody who uses Python, plans

Counting bits in large string / bit vector

2011-09-26 Thread bmacinnis
In Perl I can create a large bit vector as follows: vec($bitmap,1000,1) = 0;# this will create a bit string of all zeros To set bits I may using commands like: vec($bitmap,1000, 1) = 1 # turn on bit 1000 vec($bitmap,1, 1) = 1# turn on bit 1

Re: Counting bits in large string / bit vector

2011-09-26 Thread Nizamov Shawkat
Is there an equivalent command in python that would immediately provide the number of set bits in a large bit vector/string You might be able to achieve this using numpy boolean array and, e.g, the arithmetic sum function or something similar. There is also another library

Hierarchical commnd line parsing / help texts

2011-09-26 Thread Gelonida N
Hi, So far I used optparse.OptionParser for parsing command line arguments for my python scripts. So far I was happy, with a one level approach, where I get only one help text Now I'd like to create a slightly different python script and wondered which approach / module might be best for

Re: Hierarchical commnd line parsing / help texts

2011-09-26 Thread Chris Rebert
On Mon, Sep 26, 2011 at 1:55 AM, Gelonida N gelon...@gmail.com wrote: Hi, So far I used optparse.OptionParser for parsing command line arguments for my python scripts. So far I was happy, with a one level approach, where I get only one help text Now I'd like to create a slightly different

Re: Counting bits in large string / bit vector

2011-09-26 Thread Peter Otten
bmacin...@comcast.net wrote: In Perl I can create a large bit vector as follows: vec($bitmap,1000,1) = 0;# this will create a bit string of all zeros To set bits I may using commands like: vec($bitmap,1000, 1) = 1 # turn on bit 1000 vec($bitmap,1, 1) = 1

Re: Hierarchical commnd line parsing / help texts

2011-09-26 Thread Gelonida N
On 09/26/2011 11:10 AM, Chris Rebert wrote: On Mon, Sep 26, 2011 at 1:55 AM, Gelonida N gelon...@gmail.com wrote: Hi, So far I used optparse.OptionParser for parsing command line arguments for my python scripts. So far I was happy, with a one level approach, where I get only one help text

Re: Counting bits in large string / bit vector

2011-09-26 Thread Arnaud Delobelle
b = numpy.zeros(10**7, dtype=bool) for x in 3, 4, 6: b[10**x] = True ... b.sum() 3 Without numpy: counts = [bin(i).count('1') for i in range(256)] bytes = bhello python*10 len(bytes)*8 960 sum(map(counts.__getitem__, bytes)) 480 Pretty fast as well. -- Arnaud --

Wrote a new library - Comments and suggestions please!

2011-09-26 Thread Tal Einat
The library is called RunningCalcs and is useful for running several calculations on a single iterable of values. https://bitbucket.org/taleinat/runningcalcs/ http://pypi.python.org/pypi/RunningCalcs/ I'd like some input on how this could be made more useful and how to spread the word about it.

Re: Counting bits in large string / bit vector

2011-09-26 Thread casevh
On Sep 26, 12:56 am, Nizamov Shawkat nizamov.shaw...@gmail.com wrote: Is there an equivalent command in python that would immediately provide the number of set bits in a large bit vector/string You might be able to achieve this using numpy boolean array and, e.g, the arithmetic sum function

Re: Counting bits in large string / bit vector

2011-09-26 Thread Ian Kelly
On Sep 26, 2011 1:49 AM, bmacin...@comcast.net wrote: Is there an equivalent command in python that would immediately provide the number of set bits in a large bit vector/string Besides what others have said, if you expect the number of bits set to be small, you might just use a set. bits =

Python Weekly

2011-09-26 Thread Rahul
Hi Everyone, I have started a free weekly newsletter called Python Weekly which includes curated news, articles, new releases, software tools, events, jobs etc about Python and related technologies. It's a great way to keep abreast of what's happening in Python land. You can subscribe to it

Re: Python 2.5 zlib trouble

2011-09-26 Thread Jesramz
I appreciate all the help, but I am still a little confused. Sorry, I'm a lay person. Should I download zlib1g-dev and install it to get the zlib module? and Alter the configure script to avoid future issues? Also about getting zlib I found the following: I was able to recompile zlib

Re: Python 2.5 zlib trouble

2011-09-26 Thread Benjamin Kaplan
On Mon, Sep 26, 2011 at 2:16 PM, Jesramz jesus.ramirez.ute...@gmail.com wrote: I appreciate all the help, but I am still a little confused. Sorry, I'm a lay person. Should I download zlib1g-dev and install it to get the zlib module? and Alter the configure script to avoid future issues?

RE: Hierarchical commnd line parsing / help texts

2011-09-26 Thread Prasad, Ramit
It seems it's time to start reading about argparse FYI, it only appears on Python 2.7+ Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 This email is confidential and subject to important disclaimers

Re: Hierarchical commnd line parsing / help texts

2011-09-26 Thread Paul Rudin
Prasad, Ramit ramit.pra...@jpmorgan.com writes: This email is confidential... Probably a bad idea to post it to a world readable mailing list then :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrote a new library - Comments and suggestions please!

2011-09-26 Thread Jon Clements
On Sep 26, 12:23 pm, Tal Einat talei...@gmail.com wrote: The library is called RunningCalcs and is useful for running several calculations on a single iterable of values. https://bitbucket.org/taleinat/runningcalcs/http://pypi.python.org/pypi/RunningCalcs/ I'd like some input on how this

Re: Hierarchical commnd line parsing / help texts

2011-09-26 Thread Tim Chase
On 09/26/11 13:57, Prasad, Ramit wrote: It seems it's time to start reading about argparse FYI, it only appears on Python 2.7+ However I believe it can be uneventfully copied and run under several versions earlier (likely back to 2.5, perhaps to 2.4 -- I no longer have 2.4 at my fingertips

Re: Hierarchical commnd line parsing / help texts

2011-09-26 Thread Ian Kelly
On Mon, Sep 26, 2011 at 2:11 PM, Tim Chase python.l...@tim.thechases.com wrote: On 09/26/11 13:57, Prasad, Ramit wrote: It seems it's time to start reading about argparse FYI, it only appears on Python 2.7+ However I believe it can be uneventfully copied and run under several versions

install packages with pip to older Python versions

2011-09-26 Thread Jabba Laci
Hi, I have Python 2.7 on my system. Today I wanted to try Google App Engine but it runs on Python 2.5 at Google so I installed this version on my machine next to v2.7 to avoid compatibility problems. However, when I start the Python shell v2.5 and try to import something from the GAE SDK (for

QA Engineering/ Python/ Contract/ Austin, TX

2011-09-26 Thread TOM
Tom Gugger Independent Recruiter tgug...@bex.net US Citizens or Greencard On Site QA Engineering/ Python/ Contract/ Austin, TX This is an immediate start, such as next week. I need three contractors for a 4--6 month contract in Austin, TX for Quality Assurance Engineers. The location is

Re: QA Engineering/ Python/ Contract/ Austin, TX

2011-09-26 Thread Chris Rebert
On Mon, Sep 26, 2011 at 1:56 PM, TOM tgug...@bex.net wrote: Tom Gugger Independent Recruiter tgug...@bex.net US Citizens or Greencard On Site QA Engineering/ Python/ Contract/ Austin, TX This is an immediate start, such as next week. I need three contractors Such postings belong on

Race condition deadlock in communicate when threading?

2011-09-26 Thread Atherun
In python 2.6.4 I have a fairly complex system running (copying and pasting it would be quite difficult). At its core there are builders that inherit from threading.Thread. I have some builders that run external tasks via popen and read output using communicate. I have the ability to run any

Re: install packages with pip to older Python versions

2011-09-26 Thread alex23
On Sep 27, 6:39 am, Jabba Laci jabba.l...@gmail.com wrote: So, how can I install packages for a specific version of Python (here, v2.5)? With 2.7 I use sudo pip install package_name. It's amazing what you can find when you look at the documentation:

[issue7133] test_ssl failure

2011-09-26 Thread Senthil Kumaran
Senthil Kumaran sent...@uthcode.com added the comment: Keith, was your python compiled with ssl? Any extra information to reproduce this can help. (Download 2.7.2 from python.org, do a ./configure;make and verify if this can bug can be reproduced). -- nosy: +orsenthil

[issue13024] cgitb uses stdout encoding

2011-09-26 Thread Senthil Kumaran
Changes by Senthil Kumaran sent...@uthcode.com: -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13024 ___ ___ Python-bugs-list

[issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline

2011-09-26 Thread Senthil Kumaran
Changes by Senthil Kumaran sent...@uthcode.com: -- assignee: - orsenthil nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12966 ___

[issue7133] test_ssl failure

2011-09-26 Thread Keith Briggs
Keith Briggs kbri...@users.sourceforge.net added the comment: Senthil: thanks for the reply. That's how I did build python 2.7.2 anyway. But I can't see anything about SSL in the generated config files.However, on another system (Fedora 15 with python 2.7.1), I don't get the problem.

[issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline

2011-09-26 Thread Paulie Pena
Paulie Pena paul...@gmail.com added the comment: RFC 2109's Section 4.1 Syntax: General (http://www.ietf.org/rfc/rfc2109.txt) states that the attributes and values should be tokens, which the define as (informally, a sequence of non-special, non-white space characters) from the HTTP/1.1

[issue13013] _ctypes.c: refleak

2011-09-26 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: If the function is public I guess that some external module might use it, and possibly pass a wrong argument that triggers the leak. -- nosy: +ezio.melotti ___ Python tracker

[issue13013] _ctypes.c: refleak

2011-09-26 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: If the function is public I guess that some external module might use it Agreed; That is the only case I could deduce as well, which I hinted at in msg144397. So, I will leave the error check and keep the function public for now. I will

[issue2683] subprocess.Popen.communicate takes bytes, not str

2011-09-26 Thread Christoph Schindler
Christoph Schindler h...@30hopsmax.at added the comment: The doc string refers to string instead of byte string as well. -- nosy: +hop Added file: http://bugs.python.org/file23245/subprocess_doc_string.diff ___ Python tracker rep...@bugs.python.org

[issue13049] distutils2 should not allow packages

2011-09-26 Thread Carl Meyer
New submission from Carl Meyer c...@dirtcircle.com: As discussed at http://groups.google.com/group/the-fellowship-of-the-packaging/browse_frm/thread/3b7a8ddd307d1020 , distutils2 should not allow a distribution to install files into a top-level package that is already installed from a

[issue11457] Expose nanosecond precision from system calls

2011-09-26 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Mark Dickinson wrote: I think this could work. could? Oh ye of little faith! Attached is a patch against a nice fresh trunk (2b47f0146639) that adds Decimal attributes ctime, mtime, and atime to the object returned by os.stat(). The

[issue13048] Handling of paths in first argument of imp.find_module()

2011-09-26 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: It's probably not a bad thing it's undocumented either since importing by file path was removed in Python 3, so this is another case where imp.find_module() differentiates from __import__. -- ___

[issue13047] imp.find_module() and imp.find_module(.)

2011-09-26 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: I don't think this is undocumented as much as it's unexpected behavior. I really doubt this functionality was on purpose. -- ___ Python tracker rep...@bugs.python.org

[issue13046] imp.find_module() should not find unimportable modules

2011-09-26 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: I'm w/ Ezio on this; imp.find_module() handling modules whose names can't be used by __import__() is fine. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org

[issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline

2011-09-26 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: By it crashes on the invalid line do you mean Python raises an exception, prints a traceback, and exits? Or does it seqfault, dump core, or the Windows equivavlent? -- ___ Python tracker

[issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline

2011-09-26 Thread Paulie Pena
Paulie Pena paul...@gmail.com added the comment: Sorry, by crash I did mean that it raised an exception. My program wasn't expecting cookielib to fail while reading a cookie file that it had written, so I didn't wrap the code to read the cookie file in a try..except. I would imagine that

[issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline

2011-09-26 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: It would be better to raise an exception* upon receiving a cookie. On the other hand, I presume cookies are stored in files that any process can mess with, so reading failures are always a possibility. So if you want to catch a (very rare)

[issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline

2011-09-26 Thread Paulie Pena
Paulie Pena paul...@gmail.com added the comment: OK, I'll wrap it in a try-except. Do you think the documentation should updated to make users aware of this possible problem? Thanks, Paulie -- ___ Python tracker rep...@bugs.python.org