Re: Make never ends when compiling from source

2012-01-18 Thread Lucas Moauro
Just found that the issue was that the clock was not set properly on the server. 2012/1/19 Lucas Moauro > I'm trying to install Python 2.7 from source on Centos 6.0. When running > make after first running ./configure successfully on the source directory, > it performs the checks done by the con

Re: Python Descriptor as Instance Attribute

2012-01-18 Thread Ian Kelly
On Wed, Jan 18, 2012 at 10:55 PM, Hua Yanghao wrote: > I just do not understand, why such behavior is not a default in python. > Or, is there a better design pattern here? The behavior is by design. First, keeping object behavior in the class definition simplifies the implementation and also mak

Make never ends when compiling from source

2012-01-18 Thread Lucas Moauro
I'm trying to install Python 2.7 from source on Centos 6.0. When running make after first running ./configure successfully on the source directory, it performs the checks done by the configure step again in a loop, i.e: the checks are done infinitely many times, so the compiling process never start

Python Descriptor as Instance Attribute

2012-01-18 Thread Hua Yanghao
Hi all, Currently descriptors only work as class attribute, and doesn't work as a descriptor when it is an instance attribute. e.g. if we have descriptor class DescriptorTest, class Dummy(object): d = DescriptorTest() class Dummy2(object): def __init__(self): self.d = DescriptorTe

Re: sys.argv as a list of bytes

2012-01-18 Thread Nobody
On Wed, 18 Jan 2012 09:05:42 +0100, Peter Otten wrote: >> Python has a special errorhandler, "surrogateescape" to deal with >> bytes that are not valid UTF-8. On Wed, 18 Jan 2012 11:16:27 +0100, Olive wrote: > But is it safe even if the locale is not UTF-8? Yes. Peter's reference to UTF-8 is mi

Re: Installing Python on CentOS 6 - a big pain

2012-01-18 Thread Steven D'Aprano
On Wed, 18 Jan 2012 19:10:43 -0800, alex23 wrote: > On Jan 19, 4:00 am, John Nagle wrote: >>    It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot >>    of >> work. > > There must have been some radical changes between Centos 5 & 6, then, as > building Python 2.7 from scratch took

Re: scientific notation in legend (pylab)

2012-01-18 Thread Jason Friedman
> thank you, I am trying to learn python, but I am having a hard to find > a good introduction to it. Try this: http://docs.python.org/py3k/tutorial/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python on CentOS 6 - a big pain

2012-01-18 Thread alex23
On Jan 19, 4:00 am, John Nagle wrote: >    It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot of > work. There must have been some radical changes between Centos 5 & 6, then, as building Python 2.7 from scratch took all of 10 minutes. >  Here are the official CentOS install instruc

Re: python logging filter limitation, looks intentional?

2012-01-18 Thread Terry Reedy
On 1/18/2012 4:02 PM, Chris Withers wrote: On 17/01/2012 10:48, Vinay Sajip wrote: How about an option that defaults to "backwards compatibility mode" for Python 2.7, flipped the other way in 3.3? 2.7 only gets bug fixes, and this does not seem to be one. It's not a bug, because it's like

Re: Installing Python on CentOS 6 - a big pain

2012-01-18 Thread Albert W. Hopkins
On Wed, 2012-01-18 at 10:00 -0800, John Nagle wrote: > Python does not "just work". I should be able to command > "yum install python27". (And not clobber the Python 2.6 that > comes with CentOS.) > > This sort of thing is why Python is losing market share. > > Or — and this is the mor

Re: Installing Python on CentOS 6 - a big pain

2012-01-18 Thread Steven D'Aprano
On Wed, 18 Jan 2012 10:00:47 -0800, John Nagle wrote: > This sort of thing is why Python is losing market share. Only on Planet Nagle. Do you have any evidence that Python actually *is* losing market share, or are you just trolling? -- Steven -- http://mail.python.org/mailman/listinfo

Re: unzip function?

2012-01-18 Thread Steven D'Aprano
On Wed, 18 Jan 2012 11:20:00 -0500, Devin Jeanpierre wrote: > On Wed, Jan 18, 2012 at 10:27 AM, Steven D'Aprano > wrote: >>> That zip (*sorted... >>> >>> does the unzipping. >>> >>> But it's less than intuitively obvious. >> >> *shrug* >> >> If you understand what zip does, it should be obvious.

GOZERBOT 1.0 RELEASED

2012-01-18 Thread Bart Thate
I am proud ! Version 1.0 of GOZERBOT is here in the world. 7 years of evolutionary code development. The eagle has landed, the egg is layed See http://gozerbot.org - WELCOME TO GOZERBOT — GOZERBOT v1.0.1 FINAL documentation WELCOME TO GOZERBOT¶. I am pleased to present to you version 1.0 of GOZ

Re: python logging filter limitation, looks intentional?

2012-01-18 Thread Chris Withers
On 17/01/2012 10:48, Vinay Sajip wrote: From: Chris Withers How breaking code? Configuration, maybe, but I can't see anyone being upset that filtering would begin working "the same as everything else". This just feels like a bug... Well, it means that filters that don't get called now would

from PyQt4 import QtWebKit ImportError: DLL load failed

2012-01-18 Thread goldtech
Hi, Using WinXP I installed PyQt from http://www.riverbankcomputing.co.uk/software/pyqt/download installation file: PyQt-Py2.7-x86-gpl-4.9-1 then tried: Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more infor

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

2012-01-18 Thread Jerry Hill
On Wed, Jan 18, 2012 at 1:24 PM, John Nagle wrote: > Please don't use "setuptools", the so-called "easy" > installation system in your packages. It just makes things > more complicated, adds dependencies, and needs too many weird > options if things aren't exactly where it wants them. Since >

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

2012-01-18 Thread Rick Johnson
On Jan 18, 12:24 pm, John Nagle wrote: >    Please don't use "setuptools", the so-called "easy" > installation system in your packages.  It just makes things > more complicated, adds dependencies, and needs too many weird > options if things aren't exactly where it wants them.  Since > "setuptools

Re: Installing Python on CentOS 6 - a big pain

2012-01-18 Thread J.O. Aho
John Nagle wrote: It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot of work. Here are the official CentOS install instructions: http://www.centos.org/modules/newbb/viewtopic.php?topic_id=34515&forum=41 Don't see any official about the post, it's just another forum member who po

Re: scientific notation in legend (pylab)

2012-01-18 Thread simona bellavista
thank you, I am trying to learn python, but I am having a hard to find a good introduction to it. On Jan 15, 3:27 am, Jason Friedman wrote: > > Not sure why legend annotations makes the problem different, but > perhaps this is a start: -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python on CentOS 6 - a big pain

2012-01-18 Thread Benjamin Kaplan
On Wed, Jan 18, 2012 at 1:00 PM, John Nagle wrote: >  It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot of work. >  Here are the official CentOS install instructions: > > http://www.centos.org/modules/newbb/viewtopic.php?topic_id=34515&forum=41 > > Not only do you have to build Pyth

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

2012-01-18 Thread John Nagle
Please don't use "setuptools", the so-called "easy" installation system in your packages. It just makes things more complicated, adds dependencies, and needs too many weird options if things aren't exactly where it wants them. Since "setuptools" is non-standard, it has to be installed before i

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

2012-01-18 Thread Benjamin Kaplan
On Wed, Jan 18, 2012 at 4:52 AM, 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 regards > Wilf

Re: unzip function?

2012-01-18 Thread Hrvoje Niksic
Neal Becker writes: > python has builtin zip, but not unzip > > A bit of googling found my answer for my decorate/sort/undecorate problem: > > a, b = zip (*sorted ((c,d) for c,d in zip (x,y))) > > That zip (*sorted... > > does the unzipping. > > But it's less than intuitively obvious. > > I'm thi

Installing Python on CentOS 6 - a big pain

2012-01-18 Thread John Nagle
It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot of work. Here are the official CentOS install instructions: http://www.centos.org/modules/newbb/viewtopic.php?topic_id=34515&forum=41 Not only do you have to build Python from source, you have to install a lot of stuff before y

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

2012-01-18 Thread woooee
> def conc1(a, _list = []): >     _list = _list + [a] >     return _list > for i in range(4): >     _list = conc1(i) ## <- list not passed You don't pass the list to the conc1 function, so you start with the default, an empty list, each time. -- http://mail.python.org/mailman/listinfo/pyth

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

2012-01-18 Thread Arnaud Delobelle
On 18 January 2012 09:52, 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. I think you are more likely t

in the middle of web ,there is a problem,how to parse

2012-01-18 Thread contro opinion
here is my code: import urllib import lxml.html down=" http://sc.hkex.com.hk/gb/www.hkex.com.hk/chi/market/sec_tradinfo/stockcode/eisdeqty_c.htm " file=urllib.urlopen(down).read() root=lxml.html.document_fromstring(file) data1 = root.xpath('//tr[@class="tr_normal" and .//img]') print "the row

"+=" does not work correct all alogn

2012-01-18 Thread Wilfried Falk
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 regards Wilfried BugInPython.pdf Description: Adobe PDF document -- http://

Re: unzip function?

2012-01-18 Thread Devin Jeanpierre
On Wed, Jan 18, 2012 at 10:27 AM, Steven D'Aprano wrote: >> That zip (*sorted... >> >> does the unzipping. >> >> But it's less than intuitively obvious. > > *shrug* > > If you understand what zip does, it should be obvious. Nobody likes to be told the thing they're confused about is trivial. It's

Re: unzip function?

2012-01-18 Thread Devin Jeanpierre
On Wed, Jan 18, 2012 at 10:31 AM, Rodrick Brown wrote: > Alec can you explain this behavior zip(*zipped)? Here's one way to think about it: If A is a matrix, zip(*A) returns the transpose of A. That is, the columns become rows, and the rows become columns. If you swap rows and columns, and then

Re: Plot square wave

2012-01-18 Thread Peter Otten
Yigit Turgut wrote: > Problem is I get a sawtooth instead of a square wave. I know that I > need to define points between 0,1,2 time integer values to achieve > this. But I hope there is a python trick that will yield this > time,data plot to a square wave? There is no "Python trick", pylab is sh

Re: subprocess.Popen strange bhaviour

2012-01-18 Thread Chris Rebert
On Wed, Jan 18, 2012 at 1:14 AM, Mac Smith wrote: > Hi, > > I am using subprocess.Popen to start a movie ripping command HandBrakeCLI. My > server is 64bit ubuntu server and has 8 cores. When the command starts it > uses all 8 cores upto 80%-100% and works fine, but after 270 seconds the cpu >

Re: unzip function?

2012-01-18 Thread Chris Rebert
On Wed, Jan 18, 2012 at 7:31 AM, Rodrick Brown wrote: > On Wed, Jan 18, 2012 at 10:27 AM, Alec Taylor > wrote: >> >> http://docs.python.org/library/functions.html >> >>> x = [1, 2, 3] >> >>> y = [4, 5, 6] >> >>> zipped = zip(x, y) >> >>> zipped >> [(1, 4), (2, 5), (3, 6)] >> >>> x2, y2 = zip(*zip

Re: unzip function?

2012-01-18 Thread Benjamin Kaplan
On Wed, Jan 18, 2012 at 10:31 AM, Rodrick Brown wrote: > > > On Wed, Jan 18, 2012 at 10:27 AM, Alec Taylor > wrote: >> >> http://docs.python.org/library/functions.html >> >>> x = [1, 2, 3] >> >>> y = [4, 5, 6] >> >>> zipped = zip(x, y) >> >>> zipped >> [(1, 4), (2, 5), (3, 6)] >> >>> x2, y2 = zip

Re: unzip function?

2012-01-18 Thread Steven D'Aprano
On Wed, 18 Jan 2012 09:33:34 -0500, Neal Becker wrote: > python has builtin zip, but not unzip That's because zip is (almost) its own inverse. > A bit of googling found my answer for my decorate/sort/undecorate > problem: > a, b = zip (*sorted ((c,d) for c,d in zip (x,y))) That does a lot of

Re: unzip function?

2012-01-18 Thread Rodrick Brown
On Wed, Jan 18, 2012 at 10:27 AM, Alec Taylor wrote: > http://docs.python.org/library/functions.html > >>> x = [1, 2, 3] > >>> y = [4, 5, 6] > >>> zipped = zip(x, y) > >>> zipped > [(1, 4), (2, 5), (3, 6)] > >>> x2, y2 = zip(*zipped) > >>> x == list(x2) and y == list(y2) > True > Alec can you exp

Re: unzip function?

2012-01-18 Thread Alec Taylor
http://docs.python.org/library/functions.html >>> x = [1, 2, 3] >>> y = [4, 5, 6] >>> zipped = zip(x, y) >>> zipped [(1, 4), (2, 5), (3, 6)] >>> x2, y2 = zip(*zipped) >>> x == list(x2) and y == list(y2) True -- http://mail.python.org/mailman/listinfo/python-list

Re: unzip function?

2012-01-18 Thread Alec Taylor
http://docs.python.org/library/zipfile.html ZipFile.extractall([path[, members[, pwd]]]) -- http://mail.python.org/mailman/listinfo/python-list

Plot square wave

2012-01-18 Thread Yigit Turgut
Hi all, I am trying to generate a pseudo pwm signal, low-high transition will take place when screen goes from black to white and high-low transition when white to black. As a result I am trying to plot the signal. Here is my code; import time, pylab, numpy, scipy, pygame def _func1(): glob

unzip function?

2012-01-18 Thread Neal Becker
python has builtin zip, but not unzip A bit of googling found my answer for my decorate/sort/undecorate problem: a, b = zip (*sorted ((c,d) for c,d in zip (x,y))) That zip (*sorted... does the unzipping. But it's less than intuitively obvious. I'm thinking unzip should be a builtin function,

Re: sys.argv as a list of bytes

2012-01-18 Thread Peter Otten
Olive wrote: > On Wed, 18 Jan 2012 09:05:42 +0100 > Peter Otten <__pete...@web.de> wrote: > >> Olive wrote: >> >> > In Unix the operating system pass argument as a list of C strings. >> > But C strings does corresponds to the bytes notions of Python3. Is >> > it possible to have sys.argv as a li

Re: replacing __dict__ with an OrderedDict

2012-01-18 Thread Ulrich Eckhardt
Am 06.01.2012 12:44, schrieb Peter Otten: [running unit tests in the order of their definition] class Loader(unittest.TestLoader): def getTestCaseNames(self, testCaseClass): """Return a sequence of method names found within testCaseClass sorted by co_firstlineno. "

Re: sys.argv as a list of bytes

2012-01-18 Thread Olive
On Wed, 18 Jan 2012 09:05:42 +0100 Peter Otten <__pete...@web.de> wrote: > Olive wrote: > > > In Unix the operating system pass argument as a list of C strings. > > But C strings does corresponds to the bytes notions of Python3. Is > > it possible to have sys.argv as a list of bytes ? What happen

Re: subprocess.Popen strange bhaviour

2012-01-18 Thread Steven D'Aprano
On Wed, 18 Jan 2012 14:44:37 +0530, Mac Smith wrote: > Hi, > > I am using subprocess.Popen to start a movie ripping command > HandBrakeCLI. My server is 64bit ubuntu server and has 8 cores. When the > command starts it uses all 8 cores upto 80%-100% and works fine, but > after 270 seconds the cpu

subprocess.Popen strange bhaviour

2012-01-18 Thread Mac Smith
Hi, I am using subprocess.Popen to start a movie ripping command HandBrakeCLI. My server is 64bit ubuntu server and has 8 cores. When the command starts it uses all 8 cores upto 80%-100% and works fine, but after 270 seconds the cpu usage of all the cores drops to 0% - 1%. I tried this many tim

MailingLogger 3.7.0 Released!

2012-01-18 Thread Chris Withers
I'm pleased to announce a new release of Mailinglogger. Mailinglogger provides two handlers for the standard python logging framework that enable log entries to be emailed either as the entries are logged or as a summary at the end of the running process. The handlers have the following features

Re: sys.argv as a list of bytes

2012-01-18 Thread Peter Otten
Olive wrote: > In Unix the operating system pass argument as a list of C strings. But > C strings does corresponds to the bytes notions of Python3. Is it > possible to have sys.argv as a list of bytes ? What happens if I pass > to a program an argumpent containing funny "character", for example >