Re: My extension code generator for C++

2010-07-03 Thread Stefan Behnel
Rouslan Korneychuk, 03.07.2010 19:22: The code also never uses PyArg_ParseTuple or its variants. It converts every argument using the appropriate PyX_FromY functions. I noticed PyBindGen does the following when a conversion is needed for one argument: py_retval = Py_BuildValue((char *) "(O)", va

Re: Confusion over etree.ElementTree.Element.getiterator

2010-07-03 Thread Stefan Behnel
Ben Sizer, 04.07.2010 00:32: On Jul 3, 11:12 pm, Ben Sizer wrote: >>> for el in root.getiterator(): ...print el [much output snipped] http://www.w3.org/1999/xhtml}a at d871e8> http://www.w3.org/1999/xhtml}a at d87288> http://www.w3.org/1999/xhtml}script at d87300> http://www.w3.org/19

How to disable readline when building Python?

2010-07-03 Thread Sridhar Ratnakumar
For licensing reasons, I need to disable readline, except editline on OSX, when building Python. For the life of me, I cannot figure out how this can be done ("./configure --help" does not show anything relevant); I've tried the following, and readline.so will still be built: - ./configure --w

Re: Lua is faster than Fortran???

2010-07-03 Thread sturlamolden
On 4 Jul, 06:15, Steven D'Aprano wrote: > "Need" is a bit strong. There are plenty of applications where if your > code takes 0.1 millisecond to run instead of 0.001, you won't even > notice. Or applications that are limited by the speed of I/O rather than > the CPU. > But I'm nitpicking... this

Re: Lua is faster than Fortran???

2010-07-03 Thread Steven D'Aprano
On Sat, 03 Jul 2010 20:30:30 -0700, sturlamolden wrote: > I know it's "just a benchmark" but this has to count as insanely > impressive. Beating Intel Fortran with a dynamic scripting language, how > is that even possible? By being clever, using Just In Time compilation as much as possible, and

Lua is faster than Fortran???

2010-07-03 Thread sturlamolden
I was just looking at Debian's benchmarks. It seems LuaJIT is now (on median) beating Intel Fortran! C (gcc) is running the benchmarks faster by less than a factor of two. Consider that Lua is a dynamically typed scripting language very similar to Python. LuaJIT also runs the benchmarks faster t

Re: IMAP Problems

2010-07-03 Thread Grant Edwards
> I'm trying to write a simple script which displays the basic details > of a person's mailbox. My problem is that it causes all the messages > to be marked as read on the server, > > code, mailboxen= server.list() > print mailboxen > # if it's called INBOX, then… > server.select("INBOX") Yo

Re: delegation pattern via descriptor

2010-07-03 Thread Gregory Ewing
Bruno Desthuilliers wrote: kedra marbun a écrit : if we limit our discussion to py: why __{get|set|delete}__ don't receive the 'name' & 'class' from __{getattribute|{set|del}attr}__ 'name' is the name that is searched While it would have been technically possible, I fail to imagine any use c

Re: Why are String Formatted Queries Considered So Magical?

2010-07-03 Thread Rami Chowdhury
On Saturday 03 July 2010 19:33:44 Lawrence D'Oliveiro wrote: > In message , Nobody wrote: > > On Tue, 29 Jun 2010 12:30:36 +1200, Lawrence D'Oliveiro wrote: > >>> Seriously, almost every other kind of library uses a binary API. What > >>> makes databases so special that they need a string-command b

Re: Why are String Formatted Queries Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Nobody wrote: > On Tue, 29 Jun 2010 12:30:36 +1200, Lawrence D'Oliveiro wrote: > >>> Seriously, almost every other kind of library uses a binary API. What >>> makes databases so special that they need a string-command based API? >> >> HTML is also effectively a string-based API. >

Re: Why Is Escaping Data Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Robert Kern wrote: > On 2010-06-25 19:49 , Lawrence D'Oliveiro wrote: > >> Why do people consider input sanitization so hard? > > It's not hard per se; it's just repetitive, prone to the occasional > mistake, and, frankly, really boring. But as a programmer, I’m not in the habit of

Re: Why Is Escaping Data Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Robert Kern wrote: > On 2010-06-25 19:47 , Lawrence D'Oliveiro wrote: > >> In message, Cameron >> Simpson wrote: >> >>> On 25Jun2010 15:38, Lawrence >>> D'Oliveiro wrote: >>> >>> | In message<2010062422432660794-angrybald...@gmailcom>, Owen Jacobson >>> | wrote: >>> >>> |> Why woul

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-03 Thread Lawrence D'Oliveiro
In message , Rami Chowdhury wrote: > I'm sorry, perhaps you've misunderstood what I was refuting. You posted: >> >> macro: >> >> #define Descr(v) &v, sizeof v >> >> >> >> As written, this works whatever the type of v: array, struct, >> >> whatever. > > With my code example I found that, as

Re: IMAP Problems

2010-07-03 Thread MRAB
Paul Jefferson wrote: Hi, I'm trying to write a simple script which displays the basic details of a person's mailbox. My problem is that it causes all the messages to be marked as read on the server, which is not what I'm after, and I also can't get the imap.sort command to work properly (curr

Watch Russian Spies in REAL TIME !!! - Video Evidence For Icompetento FBI Bustards

2010-07-03 Thread small Pox
Watch Russian Spies in REAL TIME !!! - Video Evidence For Icompetento FBI Bustards Watch Russian Spies in REAL TIME !!! - Video Evidence For Icompetento FBI Bustards http://www.youtube.com/watch?v=0q7yEnMjQ6U&feature=related http://www.youtube.com/watch?v=a3E2NcC0x20&feature=related http://www

Re: python app development

2010-07-03 Thread Nathan Rice
Expert Python Programming by Tarek Ziade is a fairly good book, covers a lot of core stuff, though it doesn't really cover gui app development at all. On Sat, Jul 3, 2010 at 1:48 PM, mo reina wrote: > an anyone recommend a resource (book,tutorial,etc.) that focuses on > application development in

Re: Confusion over etree.ElementTree.Element.getiterator

2010-07-03 Thread Ben Sizer
On Jul 3, 11:12 pm, Ben Sizer wrote: > >>> for el in root.getiterator(): > > ...        print el > [much output snipped] > http://www.w3.org/1999/xhtml}a at d871e8> > http://www.w3.org/1999/xhtml}a at d87288> > http://www.w3.org/1999/xhtml}script at d87300> > http://www.w3.org/1999/xhtml}script a

Confusion over etree.ElementTree.Element.getiterator

2010-07-03 Thread Ben Sizer
It seems that getiterator isn't returning the tags I ask for. >>> tree = parse('gdlibs.html') >>> root = tree.getroot() >>> for el in root.getiterator(): ...print el [much output snipped] http://www.w3.org/1999/xhtml}a at d871e8> http://www.w3.org/1999/xhtml}a at d87288> http://www.w3.org/

IMAP Problems

2010-07-03 Thread Paul Jefferson
Hi, I'm trying to write a simple script which displays the basic details of a person's mailbox. My problem is that it causes all the messages to be marked as read on the server, which is not what I'm after, and I also can't get the imap.sort command to work properly (currently commented out as I re

Re: My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk
I missed one: func="operator[]" would also work, I assume? Yes, you can also supply a function if the first parameter accepts the type being wrapped (__rop__ methods will even accept the second parameter taking the wrapped type). -- http://mail.python.org/mailman/listinfo/python-list

Re: My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk
On 07/03/2010 01:54 PM, Thomas Jollans wrote: On 07/03/2010 07:22 PM, Rouslan Korneychuk wrote: It's still in the rough, but I wanted to give an update on my C++ extension generator. It's available at http://github.com/Rouslan/PyExpose Question that pops to mind immediately: How does this diff

Re: subprocess query

2010-07-03 Thread Nobody
On Sat, 03 Jul 2010 10:33:49 -0400, Sudheer wrote: > What's wrong with the following code. The program waits indefenitely > at 'output = p2.stdout.read()' > > > from subprocess import * > > p1=Popen(['tr', 'a-z', 'A-Z'],stdin=PIPE,stdout=PIPE) > p2=Popen(['tr','A-Z', 'a-z'],stdin=p1.stdout,st

Re: python app development

2010-07-03 Thread Terry Reedy
On 7/3/2010 1:48 PM, mo reina wrote: an anyone recommend a resource (book,tutorial,etc.) that focuses on application development in python? something similar to Practical Django Projects, but for stand alone applications instead of web apps (for now). i'm in a bit of a funny place, i have a dece

RE: drag & drop in a python GUI application

2010-07-03 Thread jyoung79
Hi Alan, What OS are you running on? And by 'drag and drop' are you meaning you want to drag and drop on a GUI window, or are you wanting a droplet where you can drop your file/folder on the application icon? Jay -- > Hello there, > I know drag & drop is not possible with TK. Which widget c

Re: loading configuration files that are themselves python

2010-07-03 Thread Terry Reedy
On 7/3/2010 5:15 AM, Matthew Vernon wrote: Hi, Is there a more idiomatic way of loading in a configuration file that's python code than: _temp=__import__(path,fromlist='cachestrs') cachestrs=_temp.cachestrs ? I mean, that's pretty ugly...Plain "import" doesn't work in this case because 'path'

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread D'Arcy J.M. Cain
On Sat, 03 Jul 2010 09:48:09 -0700 John Nagle wrote: > The base Python 3.1 is installed there, but without any modules. We install modules as clients ask for them. No one has yet requested a Python 3 module. > On a hosting service, a raw Python with none of those modules isn't > very us

Re: python app development

2010-07-03 Thread Andre Alexander Bell
On 07/03/2010 07:48 PM, mo reina wrote: > an anyone recommend a resource (book,tutorial,etc.) that focuses on > application development in python? something similar to Practical > Django Projects, but for stand alone applications instead of web apps > (for now). I think you are referring to GUI ap

Re: My extension code generator for C++

2010-07-03 Thread Thomas Jollans
On 07/03/2010 07:22 PM, Rouslan Korneychuk wrote: > It's still in the rough, but I wanted to give an update on my C++ > extension generator. It's available at http://github.com/Rouslan/PyExpose Question that pops to mind immediately: How does this differentiate itself from SWIG? ( I can't say I'm

python app development

2010-07-03 Thread mo reina
an anyone recommend a resource (book,tutorial,etc.) that focuses on application development in python? something similar to Practical Django Projects, but for stand alone applications instead of web apps (for now). i'm in a bit of a funny place, i have a decent/good grasp of python syntax and my l

My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk
It's still in the rough, but I wanted to give an update on my C++ extension generator. It's available at http://github.com/Rouslan/PyExpose The documentation is a little slim right now but there is a comprehensive set of examples in test/test_kompile.py (replace the k with a c. For some reason

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread John Nagle
On 7/3/2010 5:46 AM, D'Arcy J.M. Cain wrote: On Fri, 02 Jul 2010 22:40:34 -0700 John Nagle wrote: Not according to Vex's published package list: http://www.vex.net/info/tech/pkglist/ Hold on. That *is* the generated list and Python 3.1 is on it. We have both 2.6 and 3.1. The

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread D'Arcy J.M. Cain
On 03 Jul 2010 14:24:49 GMT Steven D'Aprano wrote: > Pfft! Facts! You can prove anything you like with facts! Argumentum ad Dragnet? -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 425 1212 (DoD#0082)(e

Re: drag & drop in a python GUI application

2010-07-03 Thread John Posner
On 7/2/2010 11:20 AM, Michael Torrie wrote: On 07/01/2010 08:57 AM, Alan wrote: I know drag& drop is not possible with TK. Is this a Python Tk limitation or a Tk limitation in general? Google suggests that Tk itself supports some form of dnd. Which widget could I use for my python applicat

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread Aahz
In article , D'Arcy J.M. Cain wrote: >On Fri, 02 Jul 2010 22:40:34 -0700 >John Nagle wrote: >> >> "vex.net" isn't exactly a major hosting service. > >OK, I'll give you that. It is on the backbone of the net at 151 Front >Street in Toronto, has almost 100% uptime and uses high speed servers >but

Re: Crash in PyThread_acquire_lock

2010-07-03 Thread Antoine Pitrou
Hello, > 'thelock->locked' is for sure still locked, but I can't identify the > problem. > Its just waiting, but it gets a 'EXC_BAD_ACCESS'. The line of the > crash > in PyThread_acquire_lock is the following one: > > while ( thelock->locked ) { > status = pthread_cond_wait(&thelock->lock_re

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread Alf P. Steinbach /Usenet
* Steven D'Aprano, on 03.07.2010 16:24: On Sat, 03 Jul 2010 08:46:57 -0400, D'Arcy J.M. Cain wrote: On Fri, 02 Jul 2010 22:40:34 -0700 John Nagle wrote: Not according to Vex's published package list: http://www.vex.net/info/tech/pkglist/ Hold on. That *is* the generated list

Re: subprocess query

2010-07-03 Thread Chris Rebert
On Sat, Jul 3, 2010 at 7:33 AM, Sudheer wrote: > Hi, >  What's wrong with the following code. The program waits indefenitely > at  'output = p2.stdout.read()' > > > from subprocess import * > > p1=Popen(['tr', 'a-z', 'A-Z'],stdin=PIPE,stdout=PIPE) > p2=Popen(['tr','A-Z', 'a-z'],stdin=p1.stdout,std

subprocess query

2010-07-03 Thread Sudheer
Hi, What's wrong with the following code. The program waits indefenitely at 'output = p2.stdout.read()' from subprocess import * p1=Popen(['tr', 'a-z', 'A-Z'],stdin=PIPE,stdout=PIPE) p2=Popen(['tr','A-Z', 'a-z'],stdin=p1.stdout,stdout=PIPE) p1.stdin.write("hello") p1.stdin.close() output = p2

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread Steven D'Aprano
On Sat, 03 Jul 2010 08:46:57 -0400, D'Arcy J.M. Cain wrote: > On Fri, 02 Jul 2010 22:40:34 -0700 > John Nagle wrote: >> Not according to Vex's published package list: >> >> http://www.vex.net/info/tech/pkglist/ > > Hold on. That *is* the generated list and Python 3.1 is on it. We ha

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread D'Arcy J.M. Cain
On Fri, 02 Jul 2010 22:40:34 -0700 John Nagle wrote: > Not according to Vex's published package list: > > http://www.vex.net/info/tech/pkglist/ Hold on. That *is* the generated list and Python 3.1 is on it. We have both 2.6 and 3.1. The 3.1 version is listed right below the 2.6 one

Re: The real problem with Python 3 - no business case for conversion

2010-07-03 Thread D'Arcy J.M. Cain
On Fri, 02 Jul 2010 22:40:34 -0700 John Nagle wrote: > Not according to Vex's published package list: > > http://www.vex.net/info/tech/pkglist/ As it says on that page it may not be up to date. Look at the generated list link. I guess I should update the static page as well. > "vex

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-03 Thread Nobody
On Fri, 02 Jul 2010 12:07:33 -0700, John Nagle wrote: >> I think one point which needs to be emphasized more is what does >> python 3 bring to people. The" what's new in python 3 page" gives >> the impression that python 3 is about removing cruft. That's a very >> poor argument to push people to s

Re: delegation pattern via descriptor

2010-07-03 Thread Bruno Desthuilliers
kedra marbun a écrit : > if we limit our discussion to py: > why __{get|set|delete}__ don't receive the 'name' & 'class' from > __{getattribute|{set|del}attr}__ > 'name' is the name that is searched While it would have been technically possible, I fail to imagine any use case for this. -- http:/

Re: loading configuration files that are themselves python

2010-07-03 Thread Matthew Vernon
Peter Otten <__pete...@web.de> writes: > Matthew Vernon wrote: > > > Is there a more idiomatic way of loading in a configuration file > > that's python code than: > > > > _temp=__import__(path,fromlist='cachestrs') > > cachestrs=_temp.cachestrs > > > > ? I mean, that's pretty ugly...Plain "impo

Re: loading configuration files that are themselves python

2010-07-03 Thread Bruno Desthuilliers
Matthew Vernon a écrit : > Hi, > > Is there a more idiomatic way of loading in a configuration file > that's python code than: > > _temp=__import__(path,fromlist='cachestrs') > cachestrs=_temp.cachestrs > > ? I mean, that's pretty ugly...Plain "import" doesn't work in this > case because 'path'

Join July Global Python meetings via VOIP - Free SW HW Culture Mtgs - BerkeleyTIP

2010-07-03 Thread giovanni_re
Watch some videos. Mark your calendar. Invite your friends. Join in on IRC or Voice. Join the mailing list, say "Hi. :)" = 1) 2010.7 Videos: Building the Python Community, Steve Holden, PyCon 2010 How Python, TurboGears, and MongoDB are Transforming SourceForge.net, Rick Copeland, PyCon

Re: Sorting dicts inside dicts

2010-07-03 Thread Eli Bendersky
On Sat, Jul 3, 2010 at 03:34, MRAB wrote: > abhijeet thatte wrote: > >> Hi, >> I have a huge dict structure like below: >> >> /*{'module':{'reg_dict_0':{'name':'abc','reg_addr':'2004'},'reg_dict_1':{'name':'xyz','reg_addr':'2002'},'reg_dict_2':{'name':'pqr','reg_addr':'2008'}}*/ >> >> Module dict

Re: loading configuration files that are themselves python

2010-07-03 Thread Peter Otten
Matthew Vernon wrote: > Is there a more idiomatic way of loading in a configuration file > that's python code than: > > _temp=__import__(path,fromlist='cachestrs') > cachestrs=_temp.cachestrs > > ? I mean, that's pretty ugly...Plain "import" doesn't work in this > case because 'path' is a variab

loading configuration files that are themselves python

2010-07-03 Thread Matthew Vernon
Hi, Is there a more idiomatic way of loading in a configuration file that's python code than: _temp=__import__(path,fromlist='cachestrs') cachestrs=_temp.cachestrs ? I mean, that's pretty ugly...Plain "import" doesn't work in this case because 'path' is a variable defined elsewhere TIA, Matthe

Re: delegation pattern via descriptor

2010-07-03 Thread Thomas Jollans
On 07/03/2010 10:59 AM, kedra marbun wrote: > if we limit our discussion to py: > why __{get|set|delete}__ don't receive the 'name' & 'class' from > __{getattribute|{set|del}attr}__ > 'name' is the name that is searched > 'class' is the class whose __dict__ has 'name' bound to descriptor http://us

Re: delegation pattern via descriptor

2010-07-03 Thread Mark Lawrence
On 02/07/2010 14:28, kedra marbun wrote: hello, friendliest prog lang community on earth ;) Flattery will get you everywhere. [snip] wow, it's almost time for brazil to beat the dutch, sorry Guido ;) if fifa['wc']['2010'].winner is not brazil: raise SystemError Have you run this and get yo

Re: delegation pattern via descriptor

2010-07-03 Thread kedra marbun
if we limit our discussion to py: why __{get|set|delete}__ don't receive the 'name' & 'class' from __{getattribute|{set|del}attr}__ 'name' is the name that is searched 'class' is the class whose __dict__ has 'name' bound to descriptor delegator & delegator are terms from delegation pattern (oop) w

SCHOLARLY TESTIMONIAL VIDEO : Joseph Moshe (MOSSAD Microbiologist) Swine flu vaccine 1

2010-07-03 Thread small Pox
Joseph Moshe (MOSSAD Microbiologist) Swine flu vaccine 1 http://www.youtube.com/watch?v=9ranNpzlXIo Part 1 Today, the MSM are not talking about this case any more. Yesterday, they wanted us to believe that Joseph Moshe was a nutcase and a terrorist, arrested for threatening to bomb the White Hous

The eastern European Jews, who form 92 per cent of the world's population of those people who call themselves Jews, were originally Khazars.

2010-07-03 Thread small Pox
The eastern European Jews, who form 92 per cent of the world's population of those people who call themselves Jews, were originally Khazars. Now, what are the facts about the Jews? The Jews -- I call them Jews to you, because they are known as Jews. I don't call them Jews. I refer to them a

Ladies and gentlemen, you are about to hear a very frightening speech. This speech is an explanation of the plans now being laid to throw the United States into a third world war.

2010-07-03 Thread nanothermite911fbibustards
Ladies and gentlemen, you are about to hear a very frightening speech. This speech is an explanation of the plans now being laid to throw the United States into a third world war. A CHRISTIAN VIEW OF THE HOLOCAUST Ladies and gentlemen, you are about to hear a very frightening speech. This speec