Appending to a file using Python API

2010-07-08 Thread lavanya
Hello all, How do you append to a file using Python os::file APIs. So that it appends to the content of the file. Not adding the content to the new line. But just appends next to the exiting content of the file. Example : current content of file A B C if we append D to it, it should be A B C D N

Re: C interpreter in Lisp/scheme/python

2010-07-08 Thread Nick Keighley
On 7 July, 17:38, Rivka Miller wrote: > Although C comes with a regex library, C does not come with a regexp library > Anyone know what the first initial of L. Peter Deutsch stand for ? Laurence according to wikipedia (search time 2s) -- http://mail.python.org/mailman/listinfo/python-list

Re: C interpreter in Lisp/scheme/python

2010-07-08 Thread Nick Keighley
On 8 July, 08:08, Nick Keighley wrote: > On 7 July, 17:38, Rivka Miller wrote: > > Anyone know what the first initial of L. Peter Deutsch stand for ? > > Laurence according to wikipedia (search time 2s) oops! He was born Laurence but changed it legally to "L." including the dot -- http://mail

Re: Appending to a file using Python API

2010-07-08 Thread Steven D'Aprano
On Wed, 07 Jul 2010 23:55:46 -0700, lavanya wrote: > Hello all, > > How do you append to a file using Python os::file APIs. So that it > appends to the content of the file. Not adding the content to the new > line. But just appends next to the exiting content of the file. > > Example : current c

Re: How do I add method dynamically to module using C API?

2010-07-08 Thread Martin v. Loewis
> I tried (1) adding a __del__, but no dice, I guess > because it wasn't really an object method but just a free function in a > module; and (2) the m_free callback in the module definition structure, > but it was not called. m_free will be called if the module object gets deallocated. So if m_fre

Re: Python -- floating point arithmetic

2010-07-08 Thread Steven D'Aprano
On Thu, 08 Jul 2010 06:04:33 +0200, David Cournapeau wrote: > On Thu, Jul 8, 2010 at 5:41 AM, Zooko O'Whielacronx > wrote: >> I'm starting to think that one should use Decimals by default and >> reserve floats for special cases. >> >> This is somewhat analogous to the way that Python provides >>

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

2010-07-08 Thread Ben Finney
"Martin v. Loewis" writes: > > The point, one more time with feeling, is that the incompatibilities > > between 2.x and 3.x will *increase* over time. > > I think this is unfounded, and actually false. Since many other people have responded with similar sentiments, I can only think I must have b

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

2010-07-08 Thread Steven D'Aprano
On Wed, 07 Jul 2010 14:10:57 -0700, Brendan Abel wrote: > The entire fact that 3.x was *designed* to be incompatible should tell > you that supporting 2.x and 3.x with a single code base is a bad idea, > except for the very smallest of projects. I don't see that follows at all. If the incompatibi

Re: Python 2.7 released

2010-07-08 Thread Tim Golden
On 08/07/2010 03:17, imageguy wrote: I, too, have multiple versions installed -- newer ones for running code I haven't upgraded; older ones for compatibility testing where needed. I just install to the default c:\pythonxy directories (although I like the idea of a common root) and I put NTFS ha

simple python deployment tool

2010-07-08 Thread King
Hi, I am writing a python package deployment tool for linux based platforms. I have tried various existing tool sets but none of them is up to the mark and they have their own issues. Initially I'll start with simple approach. 1. Find all the modules/packages and copy to "lib" directory. 2. Find

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

2010-07-08 Thread Giampaolo Rodolà
2010/7/8 Michele Simionato : > On Jul 7, 10:55 pm, Carl Banks wrote: >> On Jul 7, 1:31 am, Paul McGuire wrote: >> > I just >> > couldn't get through on the python-dev list that I couldn't just >> > upgrade my code to 2.6 and then use 2to3 to keep in step across the >> > 2-3 chasm, as this would l

Re: C interpreter in Lisp/scheme/python

2010-07-08 Thread Pascal J. Bourguignon
Nick Keighley writes: > On 8 July, 08:08, Nick Keighley > wrote: >> On 7 July, 17:38, Rivka Miller wrote: > > >> > Anyone know what the first initial of L. Peter Deutsch stand for ? >> >> Laurence according to wikipedia (search time 2s) > > oops! He was born Laurence but changed it legally to "

Re: How do I add method dynamically to module using C API?

2010-07-08 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 08.07.2010 09:13: I tried (1) adding a __del__, but no dice, I guess because it wasn't really an object method but just a free function in a module; and (2) the m_free callback in the module definition structure, but it was not called. m_free will be called if the module

Re: delegation pattern via descriptor

2010-07-08 Thread Bruno Desthuilliers
kedra marbun a écrit : On Jul 7, 2:46 am, Bruno Desthuilliers wrote: Gregory Ewing a écrit : 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 na

Howto write XML file with comments?

2010-07-08 Thread Alexander Eisenhuth
Hello, - I've to write a XML document including comments - the document should be formatted that it could be viewed with a text editor What is the fastest (time for realization) approach doing it in python 2.5? Any help or hints are very welcome Thanks Alexander -- http://mail.python.org/mailm

Re: simple python deployment tool

2010-07-08 Thread Alexander Kapps
King wrote: Hi, I am writing a python package deployment tool for linux based platforms. I have tried various existing tool sets but none of them is up to the mark and they have their own issues. Initially I'll start with simple approach. I'm sorry, but your approach is not going to work. The

Re: Howto write XML file with comments?

2010-07-08 Thread Stefan Behnel
Alexander Eisenhuth, 08.07.2010 11:08: - I've to write a XML document including comments "write" in the sense of typing in a text editor? Or constructing one programmatically in memory? Or ... ? And what kind of data from what kind of source do you want to put into the document? All of th

Re: simple python deployment tool

2010-07-08 Thread King
On Jul 8, 2:21 pm, Alexander Kapps wrote: > King wrote: > > Hi, > > > I am writing a python package deployment tool for linux based > > platforms. I have tried various existing > > tool sets but none of them is up to the mark and they have their own > > issues. Initially I'll start with simple app

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-08 Thread Christian Heimes
> Really? I wasn't entirely aware of this effect of the "io" module. > Somehow, without at all paying attention (because certain third party > modules blocking me for awhile, I never looked close enough), I just > sort of thought the "io" module was mostly thin wrappers around stdio > primitives, i

Re: delegation pattern via descriptor

2010-07-08 Thread Gregory Ewing
kedra marbun wrote: i wonder what are the reasons for not passing the class on which the descriptor is attached to, what pattern is encouraged by this? The same answer applies. It's assumed that you will be writing a custom piece of code for each attribute of each class, and giving each one its

Re: Howto write XML file with comments?

2010-07-08 Thread Alexander Eisenhuth
Stefan Behnel schrieb: Alexander Eisenhuth, 08.07.2010 11:08: - I've to write a XML document including comments "write" in the sense of typing in a text editor? Or constructing one programmatically in memory? Or ... ? write means write to a file And what kind of data from what kind of so

Re: Howto write XML file with comments?

2010-07-08 Thread Stefan Behnel
Alexander Eisenhuth, 08.07.2010 12:07: Stefan Behnel schrieb: Alexander Eisenhuth, 08.07.2010 11:08: - I've to write a XML document including comments "write" in the sense of typing in a text editor? Or constructing one programmatically in memory? Or ... ? write means write to a file You

Re: C interpreter in Lisp/scheme/python

2010-07-08 Thread Mark Tarver
On 14 June, 00:07, bolega wrote: > I am trying to compare LISP/Scheme/Python for their expressiveness. > > For this, I propose a vanilla C interpreter. I have seen a book which > writes C interpreter in C. > > The criteria would be the small size and high readability of the code. > > Are there alr

Re: Python Ireland's pre-PyCon drinks - Wed, 14th July @ Trinity Capital Hotel

2010-07-08 Thread Steve Holden
Vicky Twomey-Lee wrote: > Hi All, > > Join us for drinks and a chat (a warm-up session to PyCon Ireland ;-) ). > > When: Wed 14th July, from 7pm > Where: Trinity Capital Hotel > > More details at: > http://www.python.ie/meetup/2010/python_ireland_meetup_-_july_2010/ > Hope you all had a good pi

Re: Howto write XML file with comments?

2010-07-08 Thread Alexander Eisenhuth
Sorry for my little riddle, but you solved it quite good with: - http://effbot.org/zone/element-lib.htm#prettyprint and comments are also in ElementTree (xml.etree.ElementTree.Comment) Thanks Stefan Behnel schrieb: Alexander Eisenhuth, 08.07.2010 12:07: Stefan Behnel schrieb: Alexander Eise

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 12:53 am, "Zooko O'Whielacronx" wrote: > I don't understand. I described two different problems: problem one is > that the inputs, outputs and literals of your program might be in a > different encoding (in my experience they have most commonly been in > decimal). Problem two is that you

Writing Out from 2 Lists

2010-07-08 Thread Dlanor Slegov
Hi, I am trying to find a python solution for an informatics problem I have at work. Generalized equivalent of my problem is: I have an excel sheet with column 1 and column 2 having corresponding information (much like a dictionary, however with repeating "keys"). Its like if you read down

Re: simple python deployment tool

2010-07-08 Thread Alexander Kapps
King wrote: On Jul 8, 2:21 pm, Alexander Kapps wrote: King wrote: Hi, I am writing a python package deployment tool for linux based platforms. I have tried various existing tool sets but none of them is up to the mark and they have their own issues. Initially I'll start with simple approach.

Re: Python -- floating point arithmetic

2010-07-08 Thread David Mainzer
On 07/07/2010 08:08 PM, Raymond Hettinger wrote: > On Jul 7, 5:55 am, Mark Dickinson wrote: >> On Jul 7, 1:05 pm, david mainzer wrote: >> >> >> >>> Dear Python-User, >> >>> today i create some slides about floating point arithmetic. I used an >>> example from >> >>> http://docs.python.org/tutoria

Re: Writing Out from 2 Lists

2010-07-08 Thread Chris Rebert
On Thu, Jul 8, 2010 at 4:30 AM, Dlanor Slegov wrote: > Hi, > > I am trying to find a python solution for an informatics problem I have at > work. Generalized equivalent of my problem is: > > I have an excel sheet with column 1 and column 2 having corresponding > information (much like a dictionary

Re: Argh! Name collision!

2010-07-08 Thread rantingrick
On Jul 7, 6:47 pm, "Alf P. Steinbach /Usenet" wrote: > Hm, for pure shock value I think I'll use the acronym PYthon Native Interface > Support. > > pynis! :-) Well as long as you don't put your "pynis" *pointers* in "pynie" then everything will be Ok! ;-) -- http://mail.python.org/mailman/listi

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 7:23 am, Mark Dickinson wrote: > On Jul 8, 11:58 am, Adam Skutt wrote: > > > accurately.  Moreover, in general, it's impossible to even round > > operations involving transcendental functions to an arbitrary fixed- > > precision, you may need effectively infinite precision in order to t

Re: Python -- floating point arithmetic

2010-07-08 Thread Ethan Furman
Wolfram Hinderer wrote: On 7 Jul., 19:32, Ethan Furman wrote: Nobody wrote: On Wed, 07 Jul 2010 15:08:07 +0200, Thomas Jollans wrote: you should never rely on a floating-point number to have exactly a certain value. "Never" is an overstatement. There are situations where you can rely u

Re: Is This Open To SQL Injection?

2010-07-08 Thread Victor Subervi
On Wed, Jul 7, 2010 at 2:22 PM, Stephen Hansen wrote: > First, its always best to be explicit with insert statements. Meaning, > don't rely on the underlining structure of a table, as in: > > INSERT INTO YourRandomTable VALUES ("my", "value", "here"); > > Instead, do: > > INSERT INTO YourRandomTab

Re: Python -- floating point arithmetic

2010-07-08 Thread Mark Dickinson
On Jul 8, 2:00 pm, Adam Skutt wrote: > On Jul 8, 7:23 am, Mark Dickinson wrote:> On Jul 8, > 11:58 am, Adam Skutt wrote: > > > > accurately.  Moreover, in general, it's impossible to even round > > > operations involving transcendental functions to an arbitrary fixed- > > > precision, you may n

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

2010-07-08 Thread Philip Semanchuk
On Jul 7, 2010, at 11:26 PM, Terry Reedy wrote: On 7/7/2010 5:29 AM, geremy condra wrote: On Tue, Jul 6, 2010 at 1:37 AM, Terry Reedy wrote: On 7/5/2010 9:00 PM, Philip Semanchuk wrote: On Jul 5, 2010, at 6:41 PM, Chris Rebert wrote: On Mon, Jul 5, 2010 at 3:38 PM, Philip Semanchu I port

Debugging a segmentation fault

2010-07-08 Thread dierkerdm...@mail.com
Hi, my python project crashes in a non reproducible way. With gdb I got the backtraces given below. How can I possibly figure out the reason for the segfaults that occur under Linux and Windows, using Python 2.6 in both cases. Thanks Dierk Program received signal SIGSEGV, Segmentation fault.

Re: Storing a callback function as a class member

2010-07-08 Thread Nathan Huesken
Hey, Sorry, I tried to sent only the relevant parts of the example, but the part where the error was, was left out. I defined the function, used as callback like this: class SomeClass: def callback(param): ... So I forgot the "self" parameter, and therefor the callback had a differen

Re: Python -- floating point arithmetic

2010-07-08 Thread Stefan Krah
Adam Skutt wrote: > On Jul 8, 7:23 am, Mark Dickinson wrote: > > On Jul 8, 11:58 am, Adam Skutt wrote: > > > > > accurately.  Moreover, in general, it's impossible to even round > > > operations involving transcendental functions to an arbitrary fixed- > > > precision, you may need effectively i

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 9:22 am, Mark Dickinson wrote: > On Jul 8, 2:00 pm, Adam Skutt wrote: > > > On Jul 8, 7:23 am, Mark Dickinson wrote:> On Jul 8, > > 11:58 am, Adam Skutt wrote: > > > > > accurately.  Moreover, in general, it's impossible to even round > > > > operations involving transcendental funct

Python script to install python

2010-07-08 Thread Vincent Davis
I would like to have a python script that would download the most recent svn of python, configure, make, install and cleanup after itself. I am not replacing the python version I would be using to run the script. I was struggling to get this to work and I assume someone else has done it better. An

Issues compiling 2.6.5 on AIX 6.1

2010-07-08 Thread Stopp, Bryan
I've seen other threads on this issue, but the resolution still doesn't seem to exist for me. I'm running the configure script with these parameters: ./configure --prefix=/build/tools \ --exec-prefix=/build/tools \ --enable-shared \ --enable-ipv6 \

Re: Is This Open To SQL Injection?

2010-07-08 Thread Duncan Booth
Ian wrote: > On 07/07/2010 19:38, Victor Subervi wrote: >> Hi; >> I have this code: >> >> sql = 'insert into personalDataKeys values (%s, %s, %s)' % >> (store, >> user, ', %s'.join('%s' * len(col_vals)) >> cursor.execute(sql, col_vals) >> >> Is this open to injection attacks? If so,

Re: How to test/troubshoot an extension (pylibconfig)?

2010-07-08 Thread Grant Edwards
On 2010-07-07, Grant Edwards wrote: > Oops. Those Python bindings are for version 1.3.2 of libconfig (which > does work). They don't work with the current version of libconfig. I've stripped the python bindings down to a minimal point, and I've decided there may be a memory corruption problem

Re: Python 2.7 released

2010-07-08 Thread Aahz
In article <1450078b-d5ee-437f-bd8b-8da26900f...@x27g2000yqb.googlegroups.com>, imageguy wrote: > >Sorry to be daft here, but what do you mean by a "hardlink" ? >A windows "Shortcut" ? Just to be clear, a hardlink on NTFS functions almost exactly the same as a hardlink on a Unix filesystem -- it

Re: Python 2.7 released

2010-07-08 Thread Grant Edwards
On 2010-07-08, Aahz wrote: > In article > <1450078b-d5ee-437f-bd8b-8da26900f...@x27g2000yqb.googlegroups.com>, > imageguy wrote: >> >>Sorry to be daft here, but what do you mean by a "hardlink" ? >>A windows "Shortcut" ? > > Just to be clear, a hardlink on NTFS functions almost exactly the same

Re: Python script to install python

2010-07-08 Thread Daniel Fetchinson
> I would like to have a python script that would download the most > recent svn of python, configure, make, install and cleanup after > itself. I am not replacing the python version I would be using to run > the script. > I was struggling to get this to work and I assume someone else has > done it

Re: Is This Open To SQL Injection?

2010-07-08 Thread Stephen Hansen
On 7/8/10 6:20 AM, Victor Subervi wrote: > However, I now have another error. Here is my current command: > > cursor.execute("insert into personalDataKeys (Store, User, > useFirstName, useLastName, usePhone, useCell, useFax, useAddress, > useShippingAddress, useDOB, useEmail, usePW) values (%s

Re: Python -- floating point arithmetic

2010-07-08 Thread Victor Eijkhout
Zooko O'Whielacronx wrote: > I'm starting to think that one should use Decimals by default and > reserve floats for special cases. Only if one has Power6 (or 7) which has hardware support for BCD. Otherwise you will have slow applications. Victor. -- Victor Eijkhout -- eijkhout at tacc utexas

Re: Python 2.7 released

2010-07-08 Thread Stephen Hansen
On 7/8/10 8:07 AM, Grant Edwards wrote: > On 2010-07-08, Aahz wrote: >> In article >> <1450078b-d5ee-437f-bd8b-8da26900f...@x27g2000yqb.googlegroups.com>, >> imageguy wrote: >>> >>> Sorry to be daft here, but what do you mean by a "hardlink" ? >>> A windows "Shortcut" ? >> >> Just to be clear,

Re: Python 2.7 released

2010-07-08 Thread Tim Golden
On 08/07/2010 16:07, Grant Edwards wrote: On 2010-07-08, Aahz wrote: In article<1450078b-d5ee-437f-bd8b-8da26900f...@x27g2000yqb.googlegroups.com>, imageguy wrote: Sorry to be daft here, but what do you mean by a "hardlink" ? A windows "Shortcut" ? Just to be clear, a hardlink on NTFS func

Issue with logging.config

2010-07-08 Thread Joe Hughes
Hi Python Help: I'm doing some work with logging.config and I'm running into an interesting situation. I've run this by python-help, but that didn't help so I thought I would send to the list. Here is the config file [loggers] keys=root,log,syslog [handlers] keys=console,log,syslog

Re: Python -- floating point arithmetic

2010-07-08 Thread Mark Dickinson
On Jul 8, 3:29 pm, Adam Skutt wrote: > On Jul 8, 9:22 am, Mark Dickinson wrote: > > On Jul 8, 2:00 pm, Adam Skutt wrote: > > > For some computations, the number of bits required to > > > get the desired precision can quickly overwhelm the finite limitations > > > of your machine (e.g., you run o

Re: Python script to install python

2010-07-08 Thread Vincent Davis
On Thu, Jul 8, 2010 at 9:11 AM, Daniel Fetchinson wrote: >> I would like to have a python script that would download the most >> recent svn of python, configure, make, install and cleanup after >> itself. I am not replacing the python version I would be using to run >> the script. >> I was struggl

Re: Python -- floating point arithmetic

2010-07-08 Thread Giacomo Boffi
"Zooko O'Whielacronx" writes: > I'm starting to think that one should use Decimals by default and > reserve floats for special cases. would you kindly lend me your Decimals ruler? i need to measure the sides of the triangle whose area i have to compute -- http://mail.python.org/mailman/listinfo

Re: Is This Open To SQL Injection?

2010-07-08 Thread Victor Subervi
On Thu, Jul 8, 2010 at 10:45 AM, Stephen Hansen wrote: > On 7/8/10 6:20 AM, Victor Subervi wrote: > > However, I now have another error. Here is my current command: > > > > cursor.execute("insert into personalDataKeys (Store, User, > > useFirstName, useLastName, usePhone, useCell, useFax, useA

Re: Python -- floating point arithmetic

2010-07-08 Thread Chris Rebert
On Thu, Jul 8, 2010 at 8:52 AM, Giacomo Boffi wrote: > "Zooko O'Whielacronx" writes: >> I'm starting to think that one should use Decimals by default and >> reserve floats for special cases. > > would you kindly lend me your Decimals ruler? i need to measure the > sides of the triangle whose area

Re: Python -- floating point arithmetic

2010-07-08 Thread Zooko O'Whielacronx
On Thu, Jul 8, 2010 at 4:58 AM, Adam Skutt wrote: > > I can't think of any program I've ever written where the inputs are > actually intended to be decimal.  Consider a simple video editing > program, and the user specifies a frame rate 23.976 fps.  Is that what > they really wanted?  No, they wan

Re: Is This Open To SQL Injection?

2010-07-08 Thread John Nagle
On 7/7/2010 11:52 AM, Stephen Hansen wrote: On 7/7/10 11:38 AM, Victor Subervi wrote: Hi; I have this code: sql = 'insert into personalDataKeys values (%s, %s, %s)' % (store, user, ', %s'.join('%s' * len(col_vals)) cursor.execute(sql, col_vals) Bad approach. Don't put actual data

How is Unladen Swallow coming along?

2010-07-08 Thread John Nagle
How is Unladen Swallow coming along? Looking at the site, code is being checked in and issues are being reported, but the last quarterly release was 2009 Q3. They missed their January 2010 release date for "2009 Q4", so they're now about 6 months behind their project plan. ("http://code.goog

Re: Is This Open To SQL Injection?

2010-07-08 Thread Stephen Hansen
On 7/8/10 9:03 AM, Victor Subervi wrote: > mysql> describe products Store; > +---+-+--+-+-+---+ > | Field | Type| Null | Key | Default | Extra | > +---+-+--+-+-+---+ > | Store | varchar(40) | NO | MUL | NULL|

Re: Issues compiling 2.6.5 on AIX 6.1

2010-07-08 Thread Thomas Jollans
On 07/08/2010 04:36 PM, Stopp, Bryan wrote: > I’ve seen other threads on this issue, but the resolution still doesn’t > seem to exist for me. > > > > I’m running the configure script with these parameters: > > > > ./configure --prefix=/build/tools \ > > --exec-prefix=/build/too

Re: Is This Open To SQL Injection?

2010-07-08 Thread Stephen Hansen
On 7/7/10 11:52 AM, Stephen Hansen wrote: > On 7/7/10 11:38 AM, Victor Subervi wrote: >> Hi; >> I have this code: >> >> sql = 'insert into personalDataKeys values (%s, %s, %s)' % (store, >> user, ', %s'.join('%s' * len(col_vals)) >> cursor.execute(sql, col_vals) > > First, its always best

Re: Debugging a segmentation fault

2010-07-08 Thread Paul Rubin
"dierkerdm...@mail.com" writes: > my python project crashes in a non reproducible way. With gdb I got > the backtraces given below. > How can I possibly figure out the reason for the segfaults that occur > under Linux and Windows, using Python 2.6 in both cases. It's a big C program and you have

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 11:36 am, Mark Dickinson wrote: > I think that's because we're talking at cross-purposes. > > To clarify, suppose you want to compute some value (pi;  log(2); > AGM(1, sqrt(2)); whatever...) to 1000 significant decimal places. > Then typically the algorithm (sometimes known as Ziv's onio

Re: Python -- floating point arithmetic

2010-07-08 Thread Mark Dickinson
On Jul 8, 2:59 pm, Stefan Krah wrote: > pow() is trickier. Exact results have to be weeded out before > attempting the correction loop for correct rounding, and this is > complicated. > > For example, in decimal this expression takes a long time (in cdecimal > the power function is not correctly r

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 12:38 pm, "Zooko O'Whielacronx" wrote: > On Thu, Jul 8, 2010 at 4:58 AM, Adam Skutt wrote: > > > I can't think of any program I've ever written where the inputs are > > actually intended to be decimal.  Consider a simple video editing > > program, and the user specifies a frame rate 23.

Re: How to test/troubshoot an extension (pylibconfig)?

2010-07-08 Thread Grant Edwards
On 2010-07-08, Grant Edwards wrote: > On 2010-07-07, Grant Edwards wrote: > >> Oops. Those Python bindings are for version 1.3.2 of libconfig (which >> does work). They don't work with the current version of libconfig. >Python 2.6.5 (release26-maint, Jun 22 2010, 12:58:11) >[GCC 4.3.4

ANN: ActivePython 2.6.5.14 is now available

2010-07-08 Thread Sridhar Ratnakumar
We are pleased to announce the availability of ActivePython 2.6.5.14. http://www.activestate.com/activepython This is a minor release with several bug fixes. As usual, it includes an updated Python Package Manager (PyPM) with updates to essential packages such as Distribute (a compatible fo

Re: Debugging a segmentation fault

2010-07-08 Thread Christian Heimes
> my python project crashes in a non reproducible way. With gdb I got > the backtraces given below. > How can I possibly figure out the reason for the segfaults that occur > under Linux and Windows, using Python 2.6 in both cases. One of your third party C extension has a reference count bug. It l

Call for Applications - PSF Sponsored Sprints

2010-07-08 Thread Jesse Noller
The PSF is happy to open our first call for applications for sprint funding! Have you ever had a group of people together to hack towards a common goal? You've hosted a sprint! Have you ever wanted to get a group of like minded Pythonistas together to hack for a day? You're going to want to hold

Re: Is This Open To SQL Injection?

2010-07-08 Thread Victor Subervi
I've come to the realization that I don't need FKs at all here. Essentially, what I need to do is consult personalDataKeys simply to determine what data should be loaded into and retrieved from personalData. I was mistaken because the data are not interdependent, it only appeared that way superfici

pySimpleSessions - PHP sessions implemented in Python

2010-07-08 Thread christian schulze
Hey, since there is no standalone sessions module for python (at least a properly working one), I created one and thought i'd share it with you. This is the project: http://code.google.com/p/pysimplesessions/ This is the introduction: http://code.google.com/p/pysimplesessions/wiki/Introduction

Re: Python -- floating point arithmetic

2010-07-08 Thread Stefan Krah
Adam Skutt wrote: > > > I actually agree with much of what you've said.  It was just the > > "impossible" claim that went over the top (IMO).  The MPFR library > > amply demonstrates that computing many transcendental functions to > > arbitrary precision, with correctly rounded results, is indeed

RE: Issues compiling 2.6.5 on AIX 6.1

2010-07-08 Thread Stopp, Bryan
These are good points, but I've fixed the configure & config.guess on about 10 other OSS projects that I needed to compile on this machine. So I know that my changes are correct. The changes boil down to: There are a number of lines in the files that reference AIX versions for configuring details

Re: Python -- floating point arithmetic

2010-07-08 Thread Stefan Krah
Mark Dickinson wrote: > On Jul 8, 2:59 pm, Stefan Krah wrote: > > pow() is trickier. Exact results have to be weeded out before > > attempting the correction loop for correct rounding, and this is > > complicated. > > > > For example, in decimal this expression takes a long time (in cdecimal > >

RE: Issues compiling 2.6.5 on AIX 6.1

2010-07-08 Thread Stopp, Bryan
I just wanted to follow up my previous email: I tried compiling 2.7 (without editing any config.guess or configure files as they are up to date for AIX6) and it failed with the exact same errors. So I'm still stuck and not sure what I should to do get this to compile. Any other ideas out there? -

Re: Lua is faster than Fortran???

2010-07-08 Thread Luis M . González
On Jul 4, 5:58 pm, John Nagle wrote: >     TheUnladenSwallowpeople should in theory be able to reach > that level of performance.  (Both groups are employed at Google. > So their effectiveness will be compared.) > >                                 John Nagle No. Collin Winter said that they will

Re: Python -- floating point arithmetic

2010-07-08 Thread Zooko O'Whielacronx
On Thu, Jul 8, 2010 at 11:22 AM, Adam Skutt wrote: > On Jul 8, 12:38 pm, "Zooko O'Whielacronx" wrote: >> Now as a programmer you have two choices: … >> 1. accept what they typed in and losslessly store it in a decimal: … >> 2. accept what they typed in and lossily convert it to a float: > No, yo

Python Multi-Channel Audio

2010-07-08 Thread Alex Karpinski
I'm looking for some module or system of modules that can help me do a few things with audio 1. Playback of files (at least .wavs, other codecs would be nice but, hey, converting to a wav is easy) 2. Seek within the file 3. Control volume 3. Do all of these things by channel, e.g. play sound eff

Re: How is Unladen Swallow coming along?

2010-07-08 Thread Luis M . González
On Jul 8, 1:42 pm, John Nagle wrote: >     How is Unladen Swallow coming along?  Looking at the site, code is > being checked in and issues are being reported, but the last quarterly > release was 2009 Q3.  They missed their January 2010 release date > for "2009 Q4", so they're now about 6 months

Re: Python -- floating point arithmetic

2010-07-08 Thread Adam Skutt
On Jul 8, 2:00 pm, Stefan Krah wrote: > > This whole argument is a misunderstanding. Mark and I argue that correct > rounding is quite feasible in practice, you argue that you want guaranteed > execution times and memory usage. This is clear now, but was not so apparent > in the "impossible" parag

Question about odd code in libconfig bindings

2010-07-08 Thread Grant Edwards
I'm playign with Python bindings for libconfig, and one of the methods does something that seems very odd to me. The purpose of the method is to fetch the value found a a particular path within the configuration namespace. If the path exists and has a scalar value the method returns the tuple (,

"is not" operator?

2010-07-08 Thread sturlamolden
What happens here? Does Python (2.6.5) have an "is not" operator? >>> a = 5 >>> print (a is not False) True >>> print (a is (not False)) False >>> print (not (a is False)) True It seems "y is not x" fits well with spoken English, but it is also a bit surprising that "y is not x" does not mean "y

Re: Lua is faster than Fortran???

2010-07-08 Thread sturlamolden
On 4 Jul, 21:59, Stefan Behnel wrote: > > I have already said I don't care about unladen swallow. > > What I meant, was: which of these benchmarks would have to be better to > make you care? Because your decision not to care seems to be based on > exactly these benchmarks. Those are the only one

Re: "is not" operator?

2010-07-08 Thread Robert Kern
On 7/8/10 4:10 PM, sturlamolden wrote: What happens here? Does Python (2.6.5) have an "is not" operator? Yes. From Grammar/Grammar: comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless e

Re: "is not" operator?

2010-07-08 Thread John Krukoff
On Thu, 2010-07-08 at 13:10 -0700, sturlamolden wrote: > What happens here? Does Python (2.6.5) have an "is not" operator? > > >>> a = 5 > >>> print (a is not False) > True > >>> print (a is (not False)) > False > >>> print (not (a is False)) > True > > It seems "y is not x" fits well with spoken

Re: "is not" operator?

2010-07-08 Thread sturlamolden
On 8 Jul, 22:32, Robert Kern wrote: > > What happens here? Does Python (2.6.5) have an "is not" operator? > > Yes. From Grammar/Grammar: > > comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' Thanks :) -- http://mail.python.org/mailman/listinfo/python-list

Re: How is Unladen Swallow coming along?

2010-07-08 Thread John Nagle
On 7/8/2010 12:19 PM, Luis M. González wrote: On Jul 8, 1:42 pm, John Nagle wrote: How is Unladen Swallow coming along? Looking at the site, code is being checked in and issues are being reported, but the last quarterly release was 2009 Q3. They missed their January 2010 release date for

Re: "is not" operator?

2010-07-08 Thread sturlamolden
On 8 Jul, 22:29, John Krukoff wrote: > Don't forget about the similar "not in", as in: I noticed that in the grammar Robert posted. It never occurred to me as being a special operator too, but it is. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- floating point arithmetic

2010-07-08 Thread Wolfram Hinderer
On 8 Jul., 15:10, Ethan Furman wrote: > Interesting.  I knew when I posted my above comment that I was ignoring > such situations.  I cannot comment on the code itself as I am unaware of > the algorithm, and haven't studied numbers extensively (although I do > find them very interesting). > > So

object exported through manager from multiprocess module

2010-07-08 Thread Tomas Pelka
Hi all, have troubles with exporting objects through managers from multiprocess module, see example: Worker.py: ### from multiprocessing import Process from multiprocessing.managers import BaseManager import pcapy from impacket.ImpactDecoder import EthDecoder _

Re: Python Multi-Channel Audio

2010-07-08 Thread Thomas Jollans
On 07/08/2010 09:17 PM, Alex Karpinski wrote: > I'm looking for some module or system of modules that can help me do a few > things with audio > > 1. Playback of files (at least .wavs, other codecs would be nice but, hey, > converting to a wav is easy) > 2. Seek within the file > 3. Control volu

ANN: winreg_unicode 0.5.0

2010-07-08 Thread Daniel Stutzbach
I'm pleased to announce the release of winreg_unicode 0.5.0, the first release of winreg_unicode. The winreg_unicode package aims to be a drop-in replacement for Python 2's _winreg module. However, it returns unicode values where possible, similar to Python 3's winreg module. To illustrate the ne

Re: C interpreter in Lisp/scheme/python

2010-07-08 Thread George Neuner
On Thu, 08 Jul 2010 10:39:45 +0200, p...@informatimago.com (Pascal J. Bourguignon) wrote: >Nick Keighley writes: >> Nick Keighley wrote: >>> Rivka Miller wrote: >> Anyone know what the first initial of L. Peter Deutsch stand for ? >>> >>> Laurence according to wikipedia (search time 2s) >>

Re: Python Multi-Channel Audio

2010-07-08 Thread geremy condra
On Thu, Jul 8, 2010 at 2:11 PM, Thomas Jollans wrote: > On 07/08/2010 09:17 PM, Alex Karpinski wrote: >> I'm looking for some module or system of modules that can help me do a few >> things with audio >> >> 1. Playback of files (at least .wavs, other codecs would be nice but, hey, >> converting

Re: Python -- floating point arithmetic

2010-07-08 Thread Paul Rubin
Wolfram Hinderer writes: > JFTR, it works because a+b == a+b (while I don't think that a+b == b+a > holds for all a and b). I'm pretty sure IEEE 754 addition is always commutative (except maybe in the presence of infinity or NaN and maybe not even then). It differs from rational or real-number

Re: How is Unladen Swallow coming along?

2010-07-08 Thread Luis M . González
On Jul 8, 5:44 pm, John Nagle wrote: > On 7/8/2010 12:19 PM, Luis M. González wrote: > > > On Jul 8, 1:42 pm, John Nagle  wrote: > >>      How is Unladen Swallow coming along?  Looking at the site, code is > >> being checked in and issues are being reported, but the last quarterly > >> release was

Re: Python -- floating point arithmetic

2010-07-08 Thread Mark Dickinson
On Jul 8, 9:52 pm, Wolfram Hinderer wrote: > JFTR, it works because a+b == a+b (while I don't think that a+b == b+a > holds for all a and b). Actually, that's one of the few identities that's safe. Well, for non- NaN IEEE 754 floating-point, at any rate. And assuming that there's no use of exte

Re: 500 tracker orphans; we need more reviewers

2010-07-08 Thread Mark Lawrence
On 19-6-2010 23:45, Shashwat Anand wrote: Terry: Thanks for bringing this to notice. Mark: Kudos for your effort in cleaning up bugs.python.org Like I've said elsewhere, flattery will get you everywhere. :) FYI there are now 480 orphans and I've managed to get 8 issues closed. After one week

  1   2   >