Darwin build error with MacPorts Python 2.7.1 installed.

2011-03-02 Thread Santoso Wijaya
Hi, I recently tried to play around with the latest source for Python-2.7.1, and I came across this build error while trying to build a clean checkout (after `./configure`, of course): bash-3.2$ make ./Parser/asdl_c.py -h ./Include ./Parser/Python.asdl Traceback (most recent call last): File "/

Re: Darwin build error with MacPorts Python 2.7.1 installed.

2011-03-02 Thread Ned Deily
In article , Santoso Wijaya wrote: > I recently tried to play around with the latest source for Python-2.7.1, and > I came across this build error while trying to build a clean checkout (after > `./configure`, of course): > > bash-3.2$ make > ./Parser/asdl_c.py -h ./Include ./Parser/Python.asdl

Re: OT: Code Examples

2011-03-02 Thread Martin De Kauwe
On Mar 2, 3:30 am, Robert Kern wrote: > On 2/28/11 10:03 AM, Fred Marshall wrote: > > > I'm interested in developing Python-based programs, including an engineering > > app. ... re-writing from Fortran and C versions. One of the objectives > > would to > > be make reasonable use of the available

Hello Friends

2011-03-02 Thread Ashraf Ali
It’s good to be informed of the world.For lattest news just visit www.newsbeam.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Plumber, an alternative to mixin-based subclassing

2011-03-02 Thread Florian Friesdorf
On 28 Feb 2011 17:54:21 -0800, a...@pythoncraft.com (Aahz) wrote: > [posted & e-mailed] > > In article , > Florian Friesdorf wrote: > > > >An alternative to mixin-based subclassing: > > > >http://pypi.python.org/pypi/plumber > > You'll probably get more interest if you provide a summary. thx,

xml -> dict: lxml faq solution inadequate

2011-03-02 Thread Johann Spies
In the lxml-faq I read: How can I map an XML tree into a dict of dicts? I'm glad you asked. def recursive_dict(element): return element.tag, \ dict(map(recursive_dict, element)) or element.text However this does not work where you have xml-elements where there are more than one

python simplejson decoding

2011-03-02 Thread Arthur Mc Coy
Hi all, I'm trying an example (in attached file, I mean the bottom of this message). First, I create a list of 3 objects. Then I do: PutJSONObjects(objects) objects = GetJSONObjects() PutJSONObjects(objects, "objects2.json") 1) PutJSONObjects(objects) method creates objects.json file (by de

Checking against NULL will be eliminated?

2011-03-02 Thread Claudiu Popa
Hello Python-list, I don't know how to call it, but the following Python 3.2 code seems to raise a FutureWarning. def func(root=None): nonlocal arg if root: arg += 1 The warning is "FutureWarning: The behavior of this method will change in future versions. Use specific 'len(e

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Stefan Behnel
Claudiu Popa, 02.03.2011 14:51: Hello Python-list, I don't know how to call it, but the following Python 3.2 code seems to raise a FutureWarning. def func(root=None): nonlocal arg if root: arg += 1 The warning is "FutureWarning: The behavior of this method will change in

Re: python simplejson decoding

2011-03-02 Thread Peter Otten
Arthur Mc Coy wrote: > Hi all, > > > > I'm trying an example (in attached file, I mean the bottom of this > message). > > First, I create a list of 3 objects. Then I do: > > > PutJSONObjects(objects) > objects = GetJSONObjects() > PutJSONObjects(objects, "objects2.json") > > > 1) PutJSONOb

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Carl Banks
On Mar 2, 5:51 am, Claudiu Popa wrote: > Hello Python-list, > > I  don't  know how to call it, but the following Python 3.2 code seems to > raise a > FutureWarning. > > def func(root=None): >     nonlocal arg >     if root: >        arg += 1 > The  warning is "FutureWarning: The behavior of this

arbitrary precision linear algebra

2011-03-02 Thread Ben123
Hello. I have a written Python program which currently uses numpy to perform linear algebra operations. Specifically, I do matrix*matrix, matrix*vector, numpy.linalg.inv(matrix), and linalg.eig(matrix) operations. Now I am interested in allowing arbitrary precision. I have tried gmpy, bigfloat, mpm

Re: arbitrary precision linear algebra

2011-03-02 Thread Ben123
On Mar 2, 8:42 am, Ben123 wrote: > Hello. I have a written Python program which currently uses numpy to > perform linear algebra operations. Specifically, I do matrix*matrix, > matrix*vector, numpy.linalg.inv(matrix), and linalg.eig(matrix) > operations. Now I am interested in allowing arbitrary p

Re: python simplejson decoding

2011-03-02 Thread Felipe Vinturini
Hi Arthur, Maybe this link helps you: http://www.doughellmann.com/PyMOTW/json/ I used it to learn JSON. =o) Regards, Felipe. On Wed, Mar 2, 2011 at 11:24 AM, Peter Otten <__pete...@web.de> wrote: > Arthur Mc Coy wrote: > > > Hi all, > > > > > > > > I'm

Strange occasional marshal error

2011-03-02 Thread Graham Stratton
Hi, I'm using Python with ZeroMQ to distribute data around an HPC cluster. The results have been good apart from one issue which I am completely stuck with: We are using marshal for serialising objects before distributing them around the cluster, and extremely occasionally a corrupted marshal is

Re: arbitrary precision linear algebra

2011-03-02 Thread Arthur Mc Coy
What do you mean by "arbitrary precision" ? Each method of calculating of something has its own precision... -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Philip Semanchuk
On Mar 2, 2011, at 9:21 AM, Stefan Behnel wrote: > Claudiu Popa, 02.03.2011 14:51: >> Hello Python-list, >> >> >> I don't know how to call it, but the following Python 3.2 code seems to >> raise a >> FutureWarning. >> >> def func(root=None): >> nonlocal arg >> if root: >>arg

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Tom Zych
On Wed, 02 Mar 2011 06:37 -0800, "Carl Banks" wrote: > The larger reason is that boolean evaluation in Python tries to be too > many things: for some types is means "not zero", for some types it > means "empty", and for some types it means "this is a value of this > type as opposed to None". That

Re: arbitrary precision linear algebra

2011-03-02 Thread Ben123
On Mar 2, 9:04 am, Arthur Mc Coy <1984docmc...@gmail.com> wrote: > What do you mean by "arbitrary precision" ? Each method of calculating > of something has its own precision... If you are unfamiliar with arbitrary precision, I'm referring to http://en.wikipedia.org/wiki/Arbitrary-precision_arithm

Re: Various behaviors of doctest

2011-03-02 Thread Gnarlodious
On Feb 28, Peter Otten wrote: > Are you using Python 2.x? Then you cannot redefine print. Instead you have > to redirect stdout. The following example should run as a cgi script: > > #!/usr/bin/env python > import cgi > import sys > from cStringIO import StringIO ... That works! Except for Py3 I

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Steven Howe
Back at NCR, they stressed the axiom '90% of the time is spent fixing 10% of the code'. How true that axiom is. Never more so then when faced with a programming language fix like PEP 4000. Fortunately for me, I never trusted python's complex, or should I say 'overloaded' Boolean usage. If I

Re: arbitrary precision linear algebra

2011-03-02 Thread Arthur Mc Coy
On Mar 2, 5:26 pm, Ben123 wrote: > On Mar 2, 9:04 am, Arthur Mc Coy <1984docmc...@gmail.com> wrote: > > > What do you mean by "arbitrary precision" ? Each method of calculating > > of something has its own precision... > > If you are unfamiliar with arbitrary precision, I'm referring > tohttp://e

Re: arbitrary precision linear algebra

2011-03-02 Thread Ben123
On Mar 2, 10:21 am, Arthur Mc Coy <1984docmc...@gmail.com> wrote: > On Mar 2, 5:26 pm, Ben123 wrote: > > > > > > > > > > > On Mar 2, 9:04 am, Arthur Mc Coy <1984docmc...@gmail.com> wrote: > > > > What do you mean by "arbitrary precision" ? Each method of calculating > > > of something has its own

Re: python simplejson decoding

2011-03-02 Thread Arthur Mc Coy
Hi Peter, I implemented my decoder using your approach. Very positive. But that is for simple objects. My objects have nested lists. For example MyObject has property (member) called benchmarks, which is the list of defined benchmarks. I'm not sure if obj.__dict__.update will help me to copy nes

Re: arbitrary precision linear algebra

2011-03-02 Thread Robin Becker
On 02/03/2011 16:39, Ben123 wrote: ... Languages can't support infinitely large or small numbers, so try to multiply the inner variables by 10^n to increase their values if this will not involve on the method. For example, I did this when was calculating geometric means of computer benchm

Re: arbitrary precision linear algebra

2011-03-02 Thread Arthur Mc Coy
> Are you saying python cares whether I express a number as 0.001 or > scaled by 10^5 to read 100? If this is the case, I'm still stuck. I > need the full range of eigenvalues from 1 to 1E-300, so the entire > range could be scaled by 1E300 but I would still need better precision > than 1E19 If py

Re: arbitrary precision linear algebra

2011-03-02 Thread Ben123
On Mar 2, 11:28 am, Robin Becker wrote: > On 02/03/2011 16:39, Ben123 wrote: > ... > > > > > > > > >> Languages can't support infinitely large or small numbers, so try to > >> multiply the inner variables by 10^n to increase their values if this > >> will not involve on the method. For exa

Re: arbitrary precision linear algebra

2011-03-02 Thread geremy condra
On Wed, Mar 2, 2011 at 6:42 AM, Ben123 wrote: > Hello. I have a written Python program which currently uses numpy to > perform linear algebra operations. Specifically, I do matrix*matrix, > matrix*vector, numpy.linalg.inv(matrix), and linalg.eig(matrix) > operations. Now I am interested in allowin

Re: arbitrary precision linear algebra

2011-03-02 Thread geremy condra
On Wed, Mar 2, 2011 at 10:21 AM, geremy condra wrote: > On Wed, Mar 2, 2011 at 6:42 AM, Ben123 wrote: >> Hello. I have a written Python program which currently uses numpy to >> perform linear algebra operations. Specifically, I do matrix*matrix, >> matrix*vector, numpy.linalg.inv(matrix), and lin

Re: arbitrary precision linear algebra

2011-03-02 Thread Ben123
On Mar 2, 12:22 pm, geremy condra wrote: > On Wed, Mar 2, 2011 at 10:21 AM, geremy condra wrote: > > On Wed, Mar 2, 2011 at 6:42 AM, Ben123 wrote: > >> Hello. I have a written Python program which currently uses numpy to > >> perform linear algebra operations. Specifically, I do matrix*matrix, >

Re: arbitrary precision linear algebra

2011-03-02 Thread Ben123
On Mar 2, 12:22 pm, geremy condra wrote: > On Wed, Mar 2, 2011 at 10:21 AM, geremy condra wrote: > > On Wed, Mar 2, 2011 at 6:42 AM, Ben123 wrote: > >> Hello. I have a written Python program which currently uses numpy to > >> perform linear algebra operations. Specifically, I do matrix*matrix, >

Re: arbitrary precision linear algebra

2011-03-02 Thread geremy condra
On Wed, Mar 2, 2011 at 10:47 AM, Ben123 wrote: > On Mar 2, 12:22 pm, geremy condra wrote: >> On Wed, Mar 2, 2011 at 10:21 AM, geremy condra wrote: >> > On Wed, Mar 2, 2011 at 6:42 AM, Ben123 wrote: >> >> Hello. I have a written Python program which currently uses numpy to >> >> perform linear a

Re: arbitrary precision linear algebra

2011-03-02 Thread Paul Rubin
Ben123 writes: > I'll ask on the Sage forums about this. In the mean time, I'm still > trying to get arbitrary precision linear algebra in Python You probably have to use something like gmpy.mpq to implement your favorite eigenvalue computation algorithm. Maxima might be able to do it out of the

Re: TkTable and Python 3.1

2011-03-02 Thread Marcel Jakobs
Hello Chuck, I am working with Ubuntu 10.04 LTS - Lucid Lynx, Python 3.1 and Tktable2.10. I have installed Python and Tktable separatly. So I had to "tell" Python where to find Tktable. I built a file named 'tkTable.pth' in the directory "/usr/lib/python3.1/dist-packages". The file is has onl

Re: Re: TkTable and Python 3.1

2011-03-02 Thread Marcel Jakobs
... I built a file named 'tkTable.pth' in the directory "/usr/lib/python3.1/dist-packages" ... Submitted via EggHeadCafe Pass Values Between Windows Forms http://www.eggheadcafe.com/tutorials/aspnet/a3e1e170-21d9-4a59-a659-3ead05bb36f2/pass-values-between-windows-forms.aspx -- http://mail.py

Re: Re: Re: TkTable and Python 3.1

2011-03-02 Thread Marcel Jakobs
I don't know why, but every time when I have "sent" the directories name, it's not to see in the site. => '/usr/lib/python3.1/dist-packages' => Got to the home-directory of python and then save the file in the subdirectory "dist-packages". Marcel Submitted via EggHeadCafe Excel Generate High

[no subject]

2011-03-02 Thread Gert Schmidt
Von meinem iPhone gesendet -- http://mail.python.org/mailman/listinfo/python-list

Re: arbitrary precision linear algebra

2011-03-02 Thread Nobody
On Wed, 02 Mar 2011 06:42:22 -0800, Ben123 wrote: > Hello. I have a written Python program which currently uses numpy to > perform linear algebra operations. Specifically, I do matrix*matrix, > matrix*vector, numpy.linalg.inv(matrix), and linalg.eig(matrix) > operations. Now I am interested in all

ANN: Wing IDE 3.2.13 released

2011-03-02 Thread Wingware
Hi, Wingware has released version 3.2.13 of Wing IDE, an integrated development environment designed specifically for the Python programming language. This is a maintenance release for Wing 3.2 users only and includes the following improvements: * Support for Python 3.2 * 6 minor bug fixes NOT

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Steven D'Aprano
On Wed, 02 Mar 2011 08:20:56 -0800, Steven Howe wrote: > Back at NCR, they stressed the axiom '90% of the time is spent fixing > 10% of the code'. It's not an axiom, it's a platitude. Nor is it based on any objective evidence I've ever seen. > How true that axiom is. Never more so then when fa

Re: WxPython versus Tkinter.

2011-03-02 Thread Gregory Ewing
Terry Reedy wrote: PyGui seems to be purely a gui package, but it appear to be aimed only at 2.x with no interest in 3.x. I'm working on 3.x conversion right now and should have something ready soon. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-03-02 Thread Gregory Ewing
Octavian Rasnita wrote: How complete is this GUI lib compared with others that can be used in Python apps? It has most of the basic things you would want. There are one or two gaps, and I'm working on filling them. "Get the library and its documentation included in the core Python distributi

Re: WxPython versus Tkinter.

2011-03-02 Thread Corey Richardson
On 03/02/2011 07:40 PM, Gregory Ewing wrote: > Octavian Rasnita wrote: > >> How complete is this GUI lib compared with others that can be used in >> Python apps? > > It has most of the basic things you would want. There are one > or two gaps, and I'm working on filling them. What are those gaps

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Steven D'Aprano
On Wed, 02 Mar 2011 23:46:31 +, Steven D'Aprano wrote: > For starters, how about giving an example of a built-in string, list or > dictionary where `if len(x) == 0` and `if x` give different results? Er, how embarrassment... of course I mean either len(x) != 0, or not x, take your pick. --

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Tom Zych
Steven D'Aprano wrote: > Do you realise that "PEP 4000" was Tom Zych being sarcastic? There is no > PEP 4000: Eh, well, maybe 10% sarcastic, 90% facetious. Wasn't trying to give Carl a hard time. -- Tom Zych / freethin...@pobox.com Q: I'm having problems with my Windows software. Will you help

Re: arbitrary precision linear algebra

2011-03-02 Thread Ben123
On Mar 2, 4:48 pm, Nobody wrote: > On Wed, 02 Mar 2011 06:42:22 -0800, Ben123 wrote: > > Hello. I have a written Python program which currently uses numpy to > > perform linear algebra operations. Specifically, I do matrix*matrix, > > matrix*vector, numpy.linalg.inv(matrix), and linalg.eig(matrix)

Re: arbitrary precision linear algebra

2011-03-02 Thread Ben123
On Mar 2, 1:34 pm, geremy condra wrote: > On Wed, Mar 2, 2011 at 10:47 AM, Ben123 wrote: > > On Mar 2, 12:22 pm, geremy condra wrote: > >> On Wed, Mar 2, 2011 at 10:21 AM, geremy condra wrote: > >> > On Wed, Mar 2, 2011 at 6:42 AM, Ben123 wrote: > >> >> Hello. I have a written Python program w

having both dynamic and static variables

2011-03-02 Thread Yingjie Lan
Hi everyone, Variables in Python are resolved dynamically at runtime, which comes at a performance cost. However, a lot of times we don't need that feature. Variables can be determined at compile time, which should boost up speed. Therefore, I wonder if it is a good idea to have static variable

Re: having both dynamic and static variables

2011-03-02 Thread Steven D'Aprano
On Wed, 02 Mar 2011 19:45:16 -0800, Yingjie Lan wrote: > Hi everyone, > > Variables in Python are resolved dynamically at runtime, which comes at > a performance cost. However, a lot of times we don't need that feature. > Variables can be determined at compile time, which should boost up > speed.

Presentation: Offline (iPhone) Web Apps - Thurs 7pm in Lindon @ CORDA

2011-03-02 Thread AJ ONeal
Sorry for spamming you all... or not actually. I'm glad. We're going to have an awesome meeting tomorrow at CORDA with two presentations about something all your people using web frameworks are hopefully interested in: Offline Web Apps and IndexDB AND Offline Web Apps on iPhone / Android / MID

Re: having both dynamic and static variables

2011-03-02 Thread Yingjie Lan
- Original Message From: Steven D'Aprano To: python-list@python.org Sent: Thu, March 3, 2011 1:27:01 PM Subject: Re: having both dynamic and static variables On Wed, 02 Mar 2011 19:45:16 -0800, Yingjie Lan wrote: > Hi everyone, > > Variables in Python are resolved dynamically at runti

Re: WxPython versus Tkinter.

2011-03-02 Thread Gregory Ewing
Corey Richardson wrote: What are those gaps? That depends on what you consider to be essential. Things I would like to add include: * Combo box * Group box * Tab panel (aka "notebook") * Table view * Tree view * Rich text editor -- Greg -- http://mail.python.org/mailman/listinfo/python-list

2to3 and maketrans

2011-03-02 Thread Gregory Ewing
What is the recommended way to write code for 2.7 using maketrans() on text strings in such a way that it will convert correctly using 2to3? There seems to be two versions of maketrans in 3.x, one for text and one for bytes. Code that references string.maketrans ends up with the one for bytes, wh

Re: Playing WAV file with Python

2011-03-02 Thread VGNU Linux
On Wed, Mar 2, 2011 at 1:17 PM, VGNU Linux wrote: > Hi All, > How can I play WAV file in python without OS(like Linux/Windows/MAC) on a > device ? > On Google I found lot of different solution but related to OS's like > winsound, ossaudiodev etc which are not useful. > Thanks in advance. > > Rega

Python escape usage in django templates by GAE

2011-03-02 Thread Niklasro
Hi I got problems with escape displaying like junk when upgrading from django 0.96 to 1.2 with google app engine. The code is # let user choose authenticator for p in openIdProviders: p_name = p.split('.')[0] # take "AOL" from "AOL.com" p_url = p.lower()