Re: Numeric command-line options vs. negative-number arguments

2007-09-28 Thread Ben Finney
Steven Bethard <[EMAIL PROTECTED]> writes: > Did you try it and find it didn't work as you expected? No, I was commenting on the behaviour you described (hence why I said "That would be irritating"). > Argparse knows what your option flags look like, so if you specify > one, it knows it's an opt

Re: marshal bug?

2007-09-28 Thread Gary Herron
Anurag wrote: > I have been chasing a problem in my code since hours and it bolis down > to this > import marshal > marshal.dumps(str(123)) != marshal.dumps(str("123")) > > Can someone please tell me why? > when > str(123) == str("123") > > or are they different? > > it also means that > if s = s

Re: marshal bug?

2007-09-28 Thread David
On 9/28/07, Anurag <[EMAIL PROTECTED]> wrote: > I have been chasing a problem in my code since hours and it bolis down > to this > import marshal > marshal.dumps(str(123)) != marshal.dumps(str("123")) > I'm not sure why, but marshal does dump the 2 differently. ie: >>> marshal.dumps(str(123)) 's\

Re: marshal bug?

2007-09-28 Thread David
> I'm not sure why, but marshal does dump the 2 differently. ie: > > >>> marshal.dumps(str(123)) > 's\x03\x00\x00\x00123' > > >>> marshal.dumps(str("123")) > 't\x03\x00\x00\x00123' > I've just checked the source [1]. 's' refers to a regular string, 't' refers to an interned[2] string. In other w

Re: marshal bug?

2007-09-28 Thread Anurag
Thanks for the reply. It seems problem is due to """ Any string in Python can be "interned" or not, the difference being how/where the value is stored internally. The marshal module includes such information in its output. What you are doing is probably considered a misuse of the marshal module.

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
TheFlyingDutchman schrieb: >> - Abstract Base Classes >> http://www.python.org/dev/peps/pep-3119/> >> > > I like how someone here characterized decorators - those silly @ > things. They remind me of Perl. Not adding keywords for abstract and > static is like Perl not adding a keyword for cla

Re: Python 3.0 migration plans?

2007-09-28 Thread Ian Dickinson
Never would look like a good time scale to me given that a lot of the stuff I use is being ripped out -- http://mail.python.org/mailman/listinfo/python-list

Re: ValueError: too many values to unpack,>>>

2007-09-28 Thread Bruno Desthuilliers
J. Clifford Dyer a écrit : > On Thu, Sep 27, 2007 at 09:50:26PM +0200, Bruno Desthuilliers wrote > regarding Re: ValueError: too many values to unpack,>>>: >> Shawn Minisall a ?crit : (snip) >>> I did and it printed everything up until the 3rd line with 3 >>> numbers for deposits. I have since fig

Re: Numeric command-line options vs. negative-number arguments

2007-09-28 Thread Steven Bethard
Ben Finney wrote: > Steven Bethard <[EMAIL PROTECTED]> writes: >> Argparse knows what your option flags look like, so if you specify >> one, it knows it's an option. Argparse will only interpret it as a >> negative number if you specify a negative number that doesn't match >> a known option. > >

Re: A question on python performance.

2007-09-28 Thread Magnus Lycka
Joe Goldthwaite wrote: > I didn't know about the getattr function. I tried to search for that > type of function but not knowing how to word the search request, > I couldn't find it. You should really read through chapter 2 (Built-in Objects) of the library reference. All that stuff is core Pytho

Re: recipient validation with smtplib

2007-09-28 Thread Steve Holden
Robin Becker wrote: > Tim Williams wrote: >> On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote: >>> Is there a way to use smtplib to get recipient validation. I can use smtplib >>> quite happily to send emails using the locahost's sendmail, but sendmail is >>> just >>> fire and forget, so som

Re: Python 3.0 migration plans?

2007-09-28 Thread Alex Martelli
John Nagle <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > It seems that Python 3 is more significant for what it removes than > > what it adds. > > > > What are the additions that people find the most compelling? > > I'd rather see Python 2.5 finished, so it just works. And I'd r

Re: Python 3.0 migration plans?

2007-09-28 Thread John Nagle
Alex Martelli wrote: > John Nagle <[EMAIL PROTECTED]> wrote: > >> TheFlyingDutchman wrote: >>> It seems that Python 3 is more significant for what it removes than >>> what it adds. >>> >>> What are the additions that people find the most compelling? >> I'd rather see Python 2.5 finished, so it

Re: Python 3.0 migration plans?

2007-09-28 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > All serious languages are turing-complete. So can we put away with this > non-sense argument right away, please? Actually the so called "total" languages aren't Turing-complete. I think Coq is an example: every Coq function must return a value. So

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 2:49 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > >> The fact that you compare and criticise the simple annotations like > >> static or abstract with the much more powerful decorator concept shows > >> that, despite being the maintainer of a > >> soon-

Delete spaces

2007-09-28 Thread koutoo
If I have a text file that is delimited by spaces, how do I import it and get to comma delimited? Here is a row of data from the text file: 1110:55:14 265 8.5 1.4+1.1 2.5 Class-2 0 I tried a few examples from the group and it didn't work, since the fi

Re: [Zope] how do I test for the current item in an iteration

2007-09-28 Thread Andrew Milton
+---[ kamal hamzat ]-- | Dear All, | | I have this error after i added the if statement Time for you to do some reading of your own. That's three in less than an hour... -- Andrew Milton [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

is there a posh Win32 binary? or, compiling with MS 2005 Express...

2007-09-28 Thread Ray Schumacher
Is there a posh Win32 binary? Or better, has anyone successfully compiled modules for Python 2.4 with the newest "free" tools? Do I need to move to 2.5? I could not get it to compile with my (apparently incomplete) MS C++ 7.1 install (which did, however, work for weave/blitz, before). The 7.1 co

Re: Importing Module To Use Variables In A Second Module

2007-09-28 Thread Calvin Spealman
Most problems like this are caused by trying to access the attributes of the module before that module is fully executed, and thus before they are defined. For example, if you have A.py: import B data = "TEST" And B.py: import A print A.data Now, if you run A,py, it will import B before

OCBC connection

2007-09-28 Thread Sugrue, Sean
I'm trying to make an odbc connection to postgresql which is on a server using python. Does anyone have a code snippet to make a basic connection with a select query? Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: recipient validation with smtplib

2007-09-28 Thread Tim Williams
On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote: > Tim Williams wrote: > > On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote: > >> Is there a way to use smtplib to get recipient validation. I can use > >> smtplib > >> quite happily to send emails using the locahost's sendmail, but sendma

Re: Traveling Europe

2007-09-28 Thread willshak
on 9/27/2007 10:43 PM Eric Sosman said the following: > [EMAIL PROTECTED] wrote: >> World's most popular traveling destinations >> >> http://... > > "Nobody goes there any more; it's too crowded." -- LPB > Besides, "It gets late there early" -- LPB -- Bill In Hamptonburgh, NY To email, remov

Re: Bug: spurious indentation error

2007-09-28 Thread Steve Holden
Mridula Ramesh wrote: > hi. > > is this the right place to report a bug? > > i had written this by mistake: >filemenu = Menu(menu) , bg="White") > > instead of > filemenu = Menu(menu, bg="Pink") > > and the compiler kept giving me an indentation error in a line much > further down which

Bug: spurious indentation error

2007-09-28 Thread Mridula Ramesh
hi. is this the right place to report a bug? i had written this by mistake: filemenu = Menu(menu) , bg="White") instead of filemenu = Menu(menu, bg="Pink") and the compiler kept giving me an indentation error in a line much further down which was perfectly okay. i am using python 2.5.1 wi

recipient validation with smtplib

2007-09-28 Thread Robin Becker
Is there a way to use smtplib to get recipient validation. I can use smtplib quite happily to send emails using the locahost's sendmail, but sendmail is just fire and forget, so some bad addresses eg [EMAIL PROTECTED] don't cause any error in the sending application. I know some smtp setups d

Re: getopt with negative numbers?

2007-09-28 Thread Neal Becker
Ben Finney wrote: > Casey <[EMAIL PROTECTED]> writes: > >> Well, it is a hack and certainly not as clean as having getopt or >> optparse handle this natively (which I believe they should). > > I believe they shouldn't because the established interface is that a > hyphen always introduced an opti

Re: Emailing the attachment created with the Quick Screenshots Script(Python + PIL)

2007-09-28 Thread Mark Bratcher
The quick screenshots script works great for the project I'm working on and I'm trying to modify it to include emailing the JPG file it generates. I retrieved both scripts from the Python Archives. The modified script is pasted below and the errors below that. My goal is to have the latest date

FW: OCBC connection

2007-09-28 Thread Sugrue, Sean
Is this the right email list to be on for asking rather elementary python questions? If not do you have a suggestion Sean -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sugrue, Sean Sent: Friday, September 28, 2007 10:58 AM To: python-list@python.org Su

Re: OCBC connection

2007-09-28 Thread kyosohma
On Sep 28, 9:57 am, "Sugrue, Sean" <[EMAIL PROTECTED]> wrote: > I'm trying to make an odbc connection to postgresql which is on a server > using python. > Does anyone have a code snippet to make a basic connection with a select > query? > > Sean Sean, This appears to be what you're looking for:

Re: getopt with negative numbers?

2007-09-28 Thread Casey
On Sep 27, 10:47 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > I believe they shouldn't because the established interface is that a > hyphen always introduced an option unless (for those programs that > support it) a '--' option is used, as discussed. Not "THE" established interface; "AN" established

Re: Python 3.0 migration plans?

2007-09-28 Thread Marc 'BlackJack' Rintsch
On Fri, 28 Sep 2007 09:42:49 -0700, TheFlyingDutchman wrote: > Which of the common languages have higher order functions and what is > the syntax? C, C++, Pascal, Perl, PHP, Ruby have them. And of course the functional languages, most notably Lisp and Scheme as you asked for common languages. D

Re: Emailing the attachment created with the Quick Screenshots Script(Python + PIL)

2007-09-28 Thread Simon Brunning
On 9/28/07, Mark Bratcher <[EMAIL PROTECTED]> wrote: > > I tried the suggestion at the other end of this link without any luck. Does > anyone have a working script which will send the screenshot file created by > the Quick Screenshots Script (Python + PIL)? I receive errors like access > denied e

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 10:01 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 28 Sep 2007 09:42:49 -0700, TheFlyingDutchman wrote: > > Which of the common languages have higher order functions and what is > > the syntax? > > C, C++, Pascal, Perl, PHP, Ruby have them. And of course the functio

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
> You said it was a most basic language feature. I still haven't heard > anything that leads me to believe that statement is correct. What > languages implemented decorators as a most basic language feature? I was talking about Python, the programming language that is discussed in this NG. > Pyt

Re: Emailing the attachment created with the Quick Screenshots Script(Python + PIL)

2007-09-28 Thread Mark Bratcher
I tried the suggestion at the other end of this link without any luck. Does anyone have a working script which will send the screenshot file created by the Quick Screenshots Script (Python + PIL)? I receive errors like access denied errors and not defined errors. See the second example from t

Re: [Zope] how do I test for the current item in an iteration

2007-09-28 Thread Andreas Jung
--On 28. September 2007 16:36:43 +0100 kamal hamzat <[EMAIL PROTECTED]> wrote: Dear All, I have this error after i added the if statement Error Type: TypeError Error Value: mybrains.__cmp__(x,y) requires y to be a 'mybrains', not a 'int' for i in context.zCatNewsCurrent(): if i <= 5

Re: FW: OCBC connection

2007-09-28 Thread M.-A. Lemburg
On 2007-09-28 19:22, Sugrue, Sean wrote: > Is this the right email list to be on for asking rather elementary > python questions? > If not do you have a suggestion It's the right place, indeed :-) Here's an example using mxODBC: # mxODBC is available from http://www.egenix.com/products/python/mx

Re: Can I overload the compare (cmp()) function for a Lists ([]) index function?

2007-09-28 Thread xkenneth
On Sep 28, 12:30 pm, xkenneth <[EMAIL PROTECTED]> wrote: > Looking to do something similair. I'm working with alot of timestamps > and if they're within a couple seconds I need them to be indexed and > removed from a list. > Is there any possible way to index with a custom cmp() function? > > I ass

Re: Delete spaces

2007-09-28 Thread Gary Herron
[EMAIL PROTECTED] wrote: > If I have a text file that is delimited by spaces, how do I import it > and get to comma delimited? Here is a row of data from the text file: > > 1110:55:14 265 8.5 > 1.4+1.1 2.5 Class-2 0 > > I tried a few examples from the g

Re: getopt with negative numbers?

2007-09-28 Thread Steven Bethard
Casey wrote: > Ben Finney wrote: >> I believe they shouldn't because the established interface is that a >> hyphen always introduced an option unless (for those programs that >> support it) a '--' option is used, as discussed. > > Not "THE" established interface; "AN" established interface. There

Re: Python 3.0 migration plans?

2007-09-28 Thread egbert
On Thu, Sep 27, 2007 at 09:17:30PM -0400, Steve Holden wrote: > So what we need is a poll on what the questions should be. I *love* c.l.py. I will switch as soon as Debian has all the tools for an easy conversion available, and Python 3000 has reached the default release status. e -- Egbert Bouwma

C Source Code Generator For Test Cases

2007-09-28 Thread gamename
Hi, Can anyone recommend a good method of using python to generate c source code? I have tables of test cases to use as input to a process which would generate the test's source code. The Cheetah tool looks interesting. Has anyone used it? Any other suggestions? TIA, -T -- http://mail.pytho

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
> > The fact that you compare and criticise the simple annotations like > static or abstract with the much more powerful decorator concept shows > that, despite being the maintainer of a > soon-to-be-ruling-the-python-world Python 3 fork, lack understanding of > even the most basic language featur

Re: A question on python performance.

2007-09-28 Thread Bruno Desthuilliers
Joe Goldthwaite a écrit : (snip) > I guess I still think of decorators as the people > who got the gym ready for the prom. I've tried getting up to speed on > decorators but I haven't had much success. The @decorator syntax is just syntactic sugar for a common use of higher order functions. So

Re: marshal bug?

2007-09-28 Thread Gabriel Genellina
En Fri, 28 Sep 2007 04:26:39 -0300, Anurag <[EMAIL PROTECTED]> escribi�: > Now is there a easy way to by pass it (hack around it) > I tried various options but all fail e.g. > i= 123; marshal.dumps("%d"%123) != marshal.dumps("%d"%i) You can't. Don't use marshal to compare objects. You appear to

Re: Python 3.0 migration plans?

2007-09-28 Thread Erik Jones
On Sep 27, 2007, at 8:17 PM, Steve Holden wrote: > James Stroud wrote: >> Steve Holden wrote: >>> I wondered if a straw poll could get some idea of readers' thoughts >>> about when they will be migrating to 3.0 on, so I used the new >>> widget on >>> Blogger to add a poll for that. >>> >>> I'd

Re: Python 3.0 migration plans?

2007-09-28 Thread Steve Holden
TheFlyingDutchman wrote: > On Sep 28, 10:01 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Fri, 28 Sep 2007 09:42:49 -0700, TheFlyingDutchman wrote: >>> Which of the common languages have higher order functions and what is >>> the syntax? >> C, C++, Pascal, Perl, PHP, Ruby have them.

Re: Python 3.0 migration plans?

2007-09-28 Thread Stephan Deibel
Ian Dickinson wrote: > Never would look like a good time scale to me given that a lot of the stuff I > use is being ripped out Has any one actually converted any real code or significant bits of code using the 3.0 converter (in the sandbox somewhere), and if so what kinds of things actually f

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 9:30 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > You said it was a most basic language feature. I still haven't heard > > anything that leads me to believe that statement is correct. What > > languages implemented decorators as a most basic language feature? > > I was talking a

Can I overload the compare (cmp()) function for a Lists ([]) index function?

2007-09-28 Thread xkenneth
Looking to do something similair. I'm working with alot of timestamps and if they're within a couple seconds I need them to be indexed and removed from a list. Is there any possible way to index with a custom cmp() function? I assume it would be something like... list.index(something,mycmp) Than

Re: recipient validation with smtplib

2007-09-28 Thread Robin Becker
Tim Williams wrote: > On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote: >> Is there a way to use smtplib to get recipient validation. I can use smtplib >> quite happily to send emails using the locahost's sendmail, but sendmail is >> just >> fire and forget, so some bad addresses eg [EMAIL P

Re: Can I overload the compare (cmp()) function for a Lists ([]) index function?

2007-09-28 Thread irstas
On Sep 28, 8:30 pm, xkenneth <[EMAIL PROTECTED]> wrote: > Looking to do something similair. I'm working with alot of timestamps > and if they're within a couple seconds I need them to be indexed and > removed from a list. > Is there any possible way to index with a custom cmp() function? > > I assu

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
TheFlyingDutchman wrote: > >> >> The fact that you compare and criticise the simple annotations like >> static or abstract with the much more powerful decorator concept shows >> that, despite being the maintainer of a >> soon-to-be-ruling-the-python-world Python 3 fork, lack understanding of >> e

Re: Delete spaces

2007-09-28 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > If I have a text file that is delimited by spaces, spaces or tabs ? > how do I import it > and get to comma delimited? Here is a row of data from the text file: > > 1110:55:14 265 8.5 > 1.4+1.1 2.5 Class-2 0 > I tried

Re: Python 3.0 migration plans?

2007-09-28 Thread Chris Mellon
On 9/28/07, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 28, 2:49 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > TheFlyingDutchman wrote: > > > > All serious languages are turing-complete. So can we put away with this > > non-sense argument right away, please? > > You said it was a

Re: recipient validation with smtplib

2007-09-28 Thread Tim Williams
On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote: > Is there a way to use smtplib to get recipient validation. I can use smtplib > quite happily to send emails using the locahost's sendmail, but sendmail is > just > fire and forget, so some bad addresses eg [EMAIL PROTECTED] don't cause any

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
> > Decorators are syntax sugar for higher order functions. Higher order > functions are a both a basic and a fundamental language feature, and > exist in many languages. The fact that you don't know this just > proves, once again, that you like to talk more than you like to learn. Which of the co

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> All serious languages are turing-complete. So can we put away with this >> non-sense argument right away, please? > > Actually the so called "total" languages aren't Turing-complete. I > think Coq is an example: every Coq func

Re: Python 3.0 migration plans?

2007-09-28 Thread Francesco Guerrieri
On 9/28/07, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 28, 10:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > This is like listening to a four-year-old torment its parents with > > incessant questions. Do you *have* to ask every question that pops into > > your mind? > > > > In this c

Re: [Zope] how do I test for the current item in an iteration

2007-09-28 Thread Dieter Maurer
kamal hamzat wrote at 2007-9-28 16:36 +0100: >I have this error after i added the if statement > >Error Type: TypeError >Error Value: mybrains.__cmp__(x,y) requires y to be a 'mybrains', not a 'int' > > >for i in context.zCatNewsCurrent(): > if i <= 5: >print "%s: %s: %s" % (i.id, i.a

Re: Python 3.0 migration plans?

2007-09-28 Thread Jean-Paul Calderone
On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > [snip] > >In this case I asked it as part of the original question and it was >ignored. I have programmed in C and C++ and a little Pascal many years >ago. I don't remember anything about Higher Order Functions and w

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 10:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > On Sep 28, 10:01 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Fri, 28 Sep 2007 09:42:49 -0700, TheFlyingDutchman wrote: > >>> Which of the common languages have higher order functions and

Re: OCBC connection

2007-09-28 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Sep 28, 9:57 am, "Sugrue, Sean" <[EMAIL PROTECTED]> wrote: >> I'm trying to make an odbc connection to postgresql which is on a server >> using python. >> Does anyone have a code snippet to make a basic connection with a select >> query? >> >> Sean > > Sean, > > This

Re: Python 3.0 migration plans?

2007-09-28 Thread Paul Rubin
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > What is the syntax of a higher order function in C, C++ and Pascal? void qsort(int *array, int length, int width, int (*compare)()); is a C library example. I think we'd describe qsort as a HOF since one of its arguments (the comparison routine)

Re: OCBC connection

2007-09-28 Thread M.-A. Lemburg
On 2007-09-28 20:07, Steve Holden wrote: > [EMAIL PROTECTED] wrote: >> On Sep 28, 9:57 am, "Sugrue, Sean" <[EMAIL PROTECTED]> wrote: >>> I'm trying to make an odbc connection to postgresql which is on a server >>> using python. >>> Does anyone have a code snippet to make a basic connection with a s

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 11:21 am, "Francesco Guerrieri" <[EMAIL PROTECTED]> wrote: > On 9/28/07, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > > On Sep 28, 10:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > > This is like listening to a four-year-old torment its parents with > > > incessant questions. Do

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 11:16 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman <[EMAIL PROTECTED]> > wrote: > > [snip] > > >In this case I asked it as part of the original question and it was > >ignored. I have programmed in C and C++ and a little Pasca

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 11:16 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman <[EMAIL PROTECTED]> > wrote: > > [snip] > > >In this case I asked it as part of the original question and it was > >ignored. I have programmed in C and C++ and a little Pasca

Bug with lists of pairs of lists and append()

2007-09-28 Thread Gabriel Zachmann
Well, could some kind soul please explain to me why the following trivial code is misbehaving? #!/usr/bin/python s = [] l = [ 0 ] r = [0, 0] while r: x = (l,r) print x s.append( x ) l.append( r.pop(0) ) print s The output I get is: ([0], [0, 0]) ([0, 0], [0])

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
TheFlyingDutchman wrote: > On Sep 28, 11:16 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman <[EMAIL PROTECTED]> >> wrote: >> > [snip] >> >> >In this case I asked it as part of the original question and it was >> >ignored. I have programme

Re: Python 3.0 migration plans?

2007-09-28 Thread Steve Holden
TheFlyingDutchman wrote: > On Sep 28, 11:16 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman <[EMAIL PROTECTED]> >> wrote: >>> [snip] >>> In this case I asked it as part of the original question and it was >>> ignored. I have programmed in

Re: C Source Code Generator For Test Cases

2007-09-28 Thread Diez B. Roggisch
gamename wrote: > Hi, > > Can anyone recommend a good method of using python to generate c > source code? I have tables of test cases to use as input to a > process which would generate the test's source code. The Cheetah tool > looks interesting. Has anyone used it? Any other suggestions? H

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
> > Or bind resources of these pocket protectors that otherwise would lead to > answers for people that do seek enlightment... I don't think it would be correct to characterize my posts as not seeking enlightenment. I do also happen to voice my opinion which seems appropriate since this can be ch

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
TheFlyingDutchman wrote: > >> >> Or bind resources of these pocket protectors that otherwise would lead to >> answers for people that do seek enlightment... > > I don't think it would be correct to characterize my posts as not > seeking enlightenment. I do also happen to voice my opinion which >

Re: GUI for viewing/editing python data structures?

2007-09-28 Thread Joshua J. Kugler
On Thursday 27 September 2007 22:40, David wrote: > On 9/27/07, Joshua J. Kugler <[EMAIL PROTECTED]> wrote: >> A while back, I seem to remember coming across a small program that could >> view and edit python data structures via a nice expanding tree view. I'm >> now in need of something like tha

Re: Python 3.0 migration plans?

2007-09-28 Thread George Sakkis
On Sep 28, 3:29 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > One issue I have with this group and that I encountered many years ago > in the Perl group is that there is no separate group > comp.lang.python.beginner where you can ask questions without getting > hit with RTFM! and the like. W

Re: OCBC connection

2007-09-28 Thread kyosohma
On Sep 28, 1:07 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Sep 28, 9:57 am, "Sugrue, Sean" <[EMAIL PROTECTED]> wrote: > >> I'm trying to make an odbc connection to postgresql which is on a server > >> using python. > >> Does anyone have a code snippet to make a ba

Re: Bug with lists of pairs of lists and append()

2007-09-28 Thread TeroV
Gabriel Zachmann wrote: > Well, > > could some kind soul please explain to me why the following trivial code > is misbehaving? > > > #!/usr/bin/python > s = [] > l = [ 0 ] > r = [0, 0] > while r: > x = (l,r) > print x > s.append( x ) > l.append( r.pop(0) ) > print s > > > > T

Re: Python 3.0 migration plans?

2007-09-28 Thread Steve Holden
George Sakkis wrote: > On Sep 28, 3:29 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > >> One issue I have with this group and that I encountered many years ago >> in the Perl group is that there is no separate group >> comp.lang.python.beginner where you can ask questions without getting >> hi

Re: C Source Code Generator For Test Cases

2007-09-28 Thread gamename
> > How about using c-types to access your C-stuff to test, and use python + the > testcase-tables to invoke that? > Sure, that's possible. But the source code for tests (once all the parms are read) still needs to be generated. Calling the lib from python or from C, there still needs to be a wa

Re: Python 3.0 migration plans?

2007-09-28 Thread George Sakkis
On Sep 28, 11:53 am, John Nagle <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > John Nagle <[EMAIL PROTECTED]> wrote: > > >> TheFlyingDutchman wrote: > >>> It seems that Python 3 is more significant for what it removes than > >>> what it adds. > > >>> What are the additions that people find

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 12:34 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > >> Or bind resources of these pocket protectors that otherwise would lead to > >> answers for people that do seek enlightment... > > > I don't think it would be correct to characterize my posts as not

Re: Python 3.0 migration plans?

2007-09-28 Thread Carsten Haese
On Fri, 2007-09-28 at 13:00 -0700, TheFlyingDutchman wrote: > Being in a land where every nit can be picked, I am surprised that you > offered up a mailing list when I was asking for a newsgroup. nntp://news.gmane.org/gmane.comp.python.tutor -- Carsten Haese http://informixdb.sourceforge.net -

Re: OCBC connection

2007-09-28 Thread Steve Holden
[EMAIL PROTECTED] wrote: [...] >> >> >>> curs = conn.cursor() >> >>> import psycopg2 as db >> >>> conn = db.connect(database="pycon", user="username", >> password="password", host="localhost", port=5432) >> >>> curs = conn.cursor() >> >>> curs.execute("SELECT orgid, orgname FROM organ

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 12:45 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Sep 28, 3:29 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > > One issue I have with this group and that I encountered many years ago > > in the Perl group is that there is no separate group > > comp.lang.python.beginner where

Re: Python 3.0 migration plans?

2007-09-28 Thread Steve Holden
TheFlyingDutchman wrote: > On Sep 28, 12:45 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >> On Sep 28, 3:29 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: >> >>> One issue I have with this group and that I encountered many years ago >>> in the Perl group is that there is no separate group >>> com

RE: OCBC connection

2007-09-28 Thread Sugrue, Sean
I want to connect on the windows side to a solaris server which has a postgres database installed. I can connect to the postgres database using the postgres odbc connection but I'm using excel. I'd rather use python because it ports easily over to solaris. I will install psycopg2 and try the code

List search

2007-09-28 Thread Kevin Walzer
I'm having a problem with searching a list. Here's my code: mylist = ['x11', 'x11-wm', 'x11-system'] for line in mylist: if 'x11' in line: print line This results in the following output: x11 x11-wm x11-system I'm looking to return the list item that just has 'x11'. Ho

Re: Python 3.0 migration plans?

2007-09-28 Thread Colin J. Williams
Steve Holden wrote: > TheFlyingDutchman wrote: >> On Sep 28, 10:01 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >>> On Fri, 28 Sep 2007 09:42:49 -0700, TheFlyingDutchman wrote: Which of the common languages have higher order functions and what is the syntax? >>> C, C++, Pascal,

Re: List search

2007-09-28 Thread Stefan Bellon
On Fri, 28 Sep, Kevin Walzer wrote: > I'm having a problem with searching a list. Here's my code: > > mylist = ['x11', 'x11-wm', 'x11-system'] > > for line in mylist: > if 'x11' in line: > print line Just compare for equality: if line == 'x11': or print "\n".join(x

Re: Python 3.0 migration plans?

2007-09-28 Thread Kay Schluehr
On 28 Sep., 17:53, John Nagle <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > John Nagle <[EMAIL PROTECTED]> wrote: > > >> TheFlyingDutchman wrote: > >>> It seems that Python 3 is more significant for what it removes than > >>> what it adds. > > >>> What are the additions that people find the

Re: Python 3.0 migration plans?

2007-09-28 Thread Colin J. Williams
TheFlyingDutchman wrote: >> Or bind resources of these pocket protectors that otherwise would lead to >> answers for people that do seek enlightment... > > I don't think it would be correct to characterize my posts as not > seeking enlightenment. I do also happen to voice my opinion which > seems

Re: List search

2007-09-28 Thread Robert Kern
Kevin Walzer wrote: > I'm having a problem with searching a list. Here's my code: > > mylist = ['x11', 'x11-wm', 'x11-system'] > > for line in mylist: > if 'x11' in line: > print line > > This results in the following output: > > x11 > x11-wm > x11-system > > I'm looking to

Re: List search

2007-09-28 Thread Tim Williams
On 28/09/2007, Kevin Walzer <[EMAIL PROTECTED]> wrote: > I'm having a problem with searching a list. Here's my code: > > mylist = ['x11', 'x11-wm', 'x11-system'] > > for line in mylist: >if 'x11' in line: >print line > > This results in the following output: > > x11 > x11-wm

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 1:09 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > That's because the tutor list doesn't offer a newsgroup. He was probably > just trying to get rid of you. > > Now at 98.75% ... Not sure if that's the reading on your trollmeter or on the meter that measures what percentage of your pos

Re: Python and SSL

2007-09-28 Thread Heikki Toivonen
Johny wrote: > I need to use Python with SSL comunication betweeen servers. > (I use hhtplib but I think urllib2 can also be used ) > I think I need to use SSL root certificate and tell a program to > trust this certificate. You can't do secure SSL with the builtin SSL support, you need to use a

Re: Python and SSL

2007-09-28 Thread Giampaolo Rodolà
I heard that python 2.6 will include full "server-side SSL support" (whatever this means). Is it true? -- http://mail.python.org/mailman/listinfo/python-list

Re: List search

2007-09-28 Thread Kevin Walzer
Robert Kern wrote: > line == 'x11' > D'oh! That was simple, wasn't it? *smacks head* That did the trick. Thanks! -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://mail.python.org/mailman/listinfo/python-list

Checking for the existence of Duplicates

2007-09-28 Thread AndyB
I have found a lot of material on removing duplicates from a list, but I am trying to find the most efficient way to just check for the existence of duplicates in a list. Here is the best I have come up with so far: CheckList = [x[ValIndex] for x in self.__XRList[z]]

Reentrancy of Python interpreter

2007-09-28 Thread Brad Johnson
I have embedded a single threaded instance of the Python interpreter in my application. I have a place where I execute a Python command that calls into C++ code which then in turn calls back into Python using the same interpreter. I get a fatal error which is "PyThreadStage_Get: no current thread.

  1   2   >