Re: Please don't use "setuptools", the "rotten .egg" install system.

2012-01-19 Thread Lele Gaifax
John Nagle writes: > "egg" files are usually more trouble than they're worth. I find it really funny you say so, just after another thread where you proved yourself unable to come up with a working Python environment lacking an already packaged RPM of version 2.7... I know "egg" are not standar

Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Chris Angelico
On Thu, Jan 19, 2012 at 3:36 PM, Steven D'Aprano wrote: > With all the tools installed, it's a matter of a few minutes effort to > build from scratch: > > run ./configure > run make > run sudo make altinstall > > As a total n00b who'd never used make before, it took me 25 minutes > effort on my fi

Re: First python project : Tuner

2012-01-19 Thread Jérôme
Tue, 17 Jan 2012 15:16:01 +0100 Jérôme a écrit: > Hi all. > > Like others before me, I'd like to show you my first python attempt, in the > hope in can get advices on how to improve my coding. Hi. Thank you for your useful advices. - I tried to clarify the dependencies of my program by adding

Re: sys.argv as a list of bytes

2012-01-19 Thread jmfauth
> > In short: if you need to write "system" scripts on Unix, and you need them > to work reliably, you need to stick with Python 2.x. I think, understanding the coding of the characters helps a bit. I can not figure out how the example below could not be done on other systems. D:\tmp>chcp Page

Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Steven D'Aprano
On Thu, 19 Jan 2012 20:43:23 +1100, Chris Angelico wrote: > On Thu, Jan 19, 2012 at 3:36 PM, Steven D'Aprano > wrote: >> With all the tools installed, it's a matter of a few minutes effort to >> build from scratch: [...] > Now, granted, this was Debian and I can't speak for Centos. But it would

Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Chris Angelico
On Thu, Jan 19, 2012 at 9:47 PM, Steven D'Aprano wrote: > I daresay any decent package manager would be able to provide the > complete tool chain for building Python from source. But I have no idea > what tools are needed -- gcc and make, obviously, but what else? Maybe it > really is as simple as

Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Noah Hall
On Thu, Jan 19, 2012 at 10:47 AM, Steven D'Aprano wrote: > On Thu, 19 Jan 2012 20:43:23 +1100, Chris Angelico wrote: > >> On Thu, Jan 19, 2012 at 3:36 PM, Steven D'Aprano >> wrote: >>> With all the tools installed, it's a matter of a few minutes effort to >>> build from scratch: > > [...] >> Now,

Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Christian Heimes
Am 19.01.2012 12:05, schrieb Chris Angelico: > What I do is apt-get the most obvious things (g++/gcc and make, in > this case), then run configure and see if it bombs, then run make and > see if it bombs, and whenever there's a "command not found", attempt > to apt-get that command as a package nam

Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Chris Angelico
On Thu, Jan 19, 2012 at 10:16 PM, Christian Heimes wrote: > Much easier: > > $ apt-get build-dep python In the specific case where that's available, it's fine. I've not gotten into the habit of trusting it, though, largely because a lot of what I compile _isn't_ in the package manager - otherwise

multiversion flag and auto requiring import hook

2012-01-19 Thread Andrea Crotti
I'm using the multiversion flag in setuptools (-m) to be able to run many different projects, without modifying the global environment. Then thanks to pkg_resources magic and setuptools I can get automatically everything loaded. Now the problem is that we want to be able to run tests. The best

Re: multiversion flag and auto requiring import hook

2012-01-19 Thread Andrea Crotti
... Actually the main problem which I've been banging my head quite a few days alreays is this: --8<---cut here---start->8--- ERROR: Failure: AttributeError ('module' object has no attribute 'walk')

Re: unzip function?

2012-01-19 Thread Devin Jeanpierre
On Wed, Jan 18, 2012 at 6:20 PM, Steven D'Aprano wrote: > On Wed, 18 Jan 2012 11:20:00 -0500, Devin Jeanpierre wrote: > Nobody likes to be told to brush their teeth, eat their vegetables or > clean their room. Then they grow up and learn that life is full of things > that you do because you have t

Re: First python project : Tuner

2012-01-19 Thread Rick Johnson
On Jan 19, 4:44 am, Jérôme wrote: > - Most importantly, new 2.1 version comes with an absolutely pure french-free >   english-only screenshot, for your convenience. Thanks for this update. However, i need to stress that while the English language is fundamental to writing Python code, we are not

Re: Please don't use "setuptools", the "rotten .egg" install system.

2012-01-19 Thread John Nagle
On 1/19/2012 12:56 AM, Lele Gaifax wrote: John Nagle writes: "egg" files are usually more trouble than they're worth. I find it really funny you say so, just after another thread where you proved yourself unable to come up with a working Python environment lacking an already packaged RPM of

importing and nose

2012-01-19 Thread Andrea Crotti
I'm writing some code to analyse pstats statistics, and I'm trying to have some working unit tests. Suppose I have in the test directory another directory 'profiling', which contains 'x.py', and 'b.py'. Now running the following code in a script works perfectly, class TestStatParser(unittest.T

Re: Please don't use "setuptools", the "rotten .egg" install system.

2012-01-19 Thread Andrea Crotti
On 01/19/2012 05:05 PM, John Nagle wrote: I can do it, I just have better things to do than system administration. The fact that Python doesn't "just work" is part of why it's losing market share. Maybe in your home is losing market (if you're so sure post some sources). If it can be

Re: importing and nose

2012-01-19 Thread Peter Otten
Andrea Crotti wrote: > I'm writing some code to analyse pstats statistics, and I'm trying to > have some working unit tests. > Suppose I have in the test directory another directory 'profiling', > which contains 'x.py', and 'b.py'. > > Now running the following code in a script works perfectly,

Re: importing and nose

2012-01-19 Thread Andrea Crotti
On 01/19/2012 05:36 PM, Peter Otten wrote: I don't believe you. Quite sure it does: [andrea@precision test]$ cat simple.py import profile from os import path import sys prof_path = path.join(path.dirname(__file__), 'profiling') sys.path.append(prof_path) import x profile.run('x.f1()') [and

Re: importing and nose

2012-01-19 Thread Peter Otten
Andrea Crotti wrote: > On 01/19/2012 05:36 PM, Peter Otten wrote: >> >> I don't believe you. > > Quite sure it does: > > [andrea@precision test]$ cat simple.py > import profile > from os import path > import sys > > prof_path = path.join(path.dirname(__file__), 'profiling') > sys.path.append(pr

Re: "+=" does not work correct all alogn

2012-01-19 Thread Olive
On Wed, 18 Jan 2012 09:52:55 + (GMT) Wilfried Falk wrote: > Hello Pythons, >   > attached to this email is a pdf-file which shows, that  "+=" does not > work well all along. Mybe somebody of you is able to explain my > observations in this respect. I will be glad about an answer. Best > regar

verify the return value of a function

2012-01-19 Thread Jabba Laci
Hi, In a unit test, I want to verify that a function returns a cookielib.LWPCookieJar object. What is the correct way of doing that? 1) First I tried to figure out its type with type(return_value) but it is 2) return_value.__class__ .__name__ gives 'LWPCookieJar', which is bettter 3) isinstanc

Re: verify the return value of a function

2012-01-19 Thread Chris Rebert
On Thu, Jan 19, 2012 at 12:45 PM, Jabba Laci wrote: > Hi, > > In a unit test, I want to verify that a function returns a > cookielib.LWPCookieJar object. What is the correct way of doing that? > 3) isinstance(return_value, cookielib.LWPCookieJar) seems to be the > best way, however somewhere I re