Re: Is there a standard name for this tree structure?

2010-04-06 Thread Lie Ryan
On 04/07/10 14:18, Steven D'Aprano wrote: > I could have used None, or "root", or "this is a magic value that > probably won't clash with an entry in the tree", or -1 as a sentinel > instead, but they all risk accidental clashes with tree entries. Especially when you want to consider the possibi

Daily News Updates

2010-04-06 Thread dhangout
News, national news , international news, sports news, economic news, business news, cricket news, daily news, latest news, local news, top news, latest news headlines, hot gossips, top stories, news updates, special news, world news, desi news, news and gossips, news hot, hot hews, sexy news, loca

personality development

2010-04-06 Thread dhangout
Personality Tips, Office Ethics, Personality Disorder, Women Personality, Men Personality, Personality Grooming, Time Management, Yoga Tips, Social Phobia, Articles, more... http://www.dhangout.com/personality/ -- http://mail.python.org/mailman/listinfo/python-list

Free Astrology

2010-04-06 Thread dhangout
Indian Festivals, Astro Tips, Feng Shui, Vastu, Rudraksh, Numerology, Lal Kitab, Chogadia ( Timeing ), Magic of Gems, Sani Dev, Astro Food, Astro Cloths, Astro Health, Astro Travel, more.. http://www.dhangout.com/astrology/ -- http://mail.python.org/mailman/listinfo/python-list

Love Guru

2010-04-06 Thread dhangout
Love Forum, Poems, Love Letters, love Sms, Love Tips, love messages, love, love flowers, full of love, Is it love ?, Love Articles, more... http://www.dhangout.com/loveguru/ -- http://mail.python.org/mailman/listinfo/python-list

Fashion

2010-04-06 Thread dhangout
What's Hot, Fashion Tips, Model's Portfolio, Fashion News, Designers, India Fashion Week, Fashion Accessories, Fashion Polling, Fashion Magazines, Funny facts About Fashion, more...http://www.dhangout.com/ fashion/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance of list vs. set equality operations

2010-04-06 Thread Lie Ryan
On 04/07/10 04:11, Gustavo Narea wrote: > Hello! > > Could you please confirm whether my understanding of equality > operations in sets and lists is correct? This is how I think things > work, partially based on experimentation and the online documentation > for Python: > > When you compare two l

Re: (a==b) ? 'Yes' : 'No'

2010-04-06 Thread Steven D'Aprano
On Tue, 06 Apr 2010 16:54:18 +, Duncan Booth wrote: > Albert van der Horst wrote: > >> Old hands would have ... >> stamp =( weight>=1000 and 120 or >> weight>=500 and 100 or >> weight>=250 and 80 or >> weight>=100 and 60 or >>

Re: Is there a standard name for this tree structure?

2010-04-06 Thread Steven D'Aprano
On Tue, 06 Apr 2010 19:16:05 +0200, egbert wrote: > On Sun, Apr 04, 2010 at 12:10:02PM +, Steven D'Aprano wrote: > >> I can implement this tree using a flat dict: >> >> root = object() >> data = {root: ['Mammal', 'Reptile'], > > What is the advantage, or thougth behind, using an instance o

Re: lambda with floats

2010-04-06 Thread Patrick Maupin
On Apr 6, 11:10 pm, Patrick Maupin wrote: > On Apr 6, 11:04 pm, Patrick Maupin wrote: > > > > > On Apr 6, 10:16 pm, monkeys paw wrote: > > > > I have the following acre meter which works for integers, > > > how do i convert this to float? I tried > > > > return float ((208.0 * 208.0) * n) > > >

Re: lambda with floats

2010-04-06 Thread Patrick Maupin
On Apr 6, 11:04 pm, Patrick Maupin wrote: > On Apr 6, 10:16 pm, monkeys paw wrote: > > > I have the following acre meter which works for integers, > > how do i convert this to float? I tried > > > return float ((208.0 * 208.0) * n) > > >  >>> def s(n): > > ...     return lambda x: (208 * 208) * n

Re: Recommend Commercial graphing library

2010-04-06 Thread Grant Edwards
On 2010-04-07, Lie Ryan wrote: > On 04/07/10 02:22, Grant Edwards wrote: >> On 2010-04-06, Grant Edwards wrote: >>> On 2010-04-06, Jean-Michel Pichavant wrote: Pablo Recio Quijano wrote: > Why must be commercial, when there is open and free alternatives? Like > GNU Plot.

Re: lambda with floats

2010-04-06 Thread Patrick Maupin
On Apr 6, 10:16 pm, monkeys paw wrote: > I have the following acre meter which works for integers, > how do i convert this to float? I tried > > return float ((208.0 * 208.0) * n) > >  >>> def s(n): > ...     return lambda x: (208 * 208) * n > ... >  >>> f = s(1) >  >>> f(1) > 43264 >  >>> 208 * 2

Re: Q about assignment and references

2010-04-06 Thread Alf P. Steinbach
* jdbosmaus: Pretty new to Python, but I thought I understood what is meant by "an assignment is a reference." Until I tried to understand this. Here is a (fragment of an) event handler for a group of three wxPython toggle buttons. The idea is to change the appearance of the label of the button

Re: Q about assignment and references

2010-04-06 Thread Stephen Hansen
On 2010-04-06 19:51:07 -0700, jdbosmaus said: Pretty new to Python, but I thought I understood what is meant by "an assignment is a reference." An assignment isn't really a reference, it binds a name to an object. Not quite the same thing. But, what's really the problem here is -- wxPython i

Re: Performance of list vs. set equality operations

2010-04-06 Thread Jack Diederich
On Tue, Apr 6, 2010 at 2:11 PM, Gustavo Narea wrote: > Hello! > > Could you please confirm whether my understanding of equality > operations in sets and lists is correct? This is how I think things > work, partially based on experimentation and the online documentation > for Python: > > When you c

Re: Q about assignment and references

2010-04-06 Thread Chris Rebert
On Tue, Apr 6, 2010 at 7:51 PM, jdbosmaus wrote: > Pretty new to Python, but I thought I understood what is meant by "an > assignment is a reference." I recommend the effbot's treatment of the calling semantics: http://effbot.org/zone/call-by-object.htm ...But I don't think that's the issue here

lambda with floats

2010-04-06 Thread monkeys paw
I have the following acre meter which works for integers, how do i convert this to float? I tried return float ((208.0 * 208.0) * n) >>> def s(n): ... return lambda x: (208 * 208) * n ... >>> f = s(1) >>> f(1) 43264 >>> 208 * 208 43264 >>> f(.25) 43264 -- http://mail.python.org/mailman/listi

Q about assignment and references

2010-04-06 Thread jdbosmaus
Pretty new to Python, but I thought I understood what is meant by "an assignment is a reference." Until I tried to understand this. Here is a (fragment of an) event handler for a group of three wxPython toggle buttons. The idea is to change the appearance of the label of the button that was press

Re: PIL question

2010-04-06 Thread Lie Ryan
On 04/06/10 19:47, Peter Otten wrote: > Tim Eichholz wrote: > >> I think maybe I am using the wrong function. I want to paste the >> entire 192x192 contents of cols[f] into newimage. I would think it >> works like newimage.paste(cols[f], (x, 0, 192+x, 192)) if that's not >> it I think I'm missing

Re: Recommend Commercial graphing library

2010-04-06 Thread Lie Ryan
On 04/07/10 02:22, Grant Edwards wrote: > On 2010-04-06, Grant Edwards wrote: >> On 2010-04-06, Jean-Michel Pichavant wrote: >>> Pablo Recio Quijano wrote: Why must be commercial, when there is open and free alternatives? Like GNU Plot. >>> >>> Gnuplot is ugly. I'm using it because I d

Re: s-expression parser in python

2010-04-06 Thread Paul McGuire
On Apr 6, 7:02 pm, James Stroud wrote: > Hello All, > > I want to use an s-expression based configuration file format for a > python program I'm writing. Does anyone have a favorite parser? > The pyparsing wiki includes this parser on its Examples page: http://pyparsing.wikispaces.com/file/view/s

Re: python as pen and paper substitute

2010-04-06 Thread Ethan Furman
Manuel Graune wrote: Manuel Graune writes: The use-case is acually fairly simple. The point is to use a python source-file as subsitute for scrap-paper (with the opportunity to edit what is already written and without illegible handwriting). The output should 1) show manually selected python c

Re: s-expression parser in python

2010-04-06 Thread Patrick Maupin
On Apr 6, 7:02 pm, James Stroud wrote: I have a parser/emitter I wrote about 4 years ago for EDIF. Take a look at the wikipedia article http://en.wikipedia.org/wiki/EDIF If that is close to you want, I can send it to you. The whole parser/ emitter/XML round-tripper etc. is only 500 lines, whic

Re: python as pen and paper substitute

2010-04-06 Thread James Stroud
Manuel Graune wrote: Hello everyone, I am looking for ways to use a python file as a substitute for simple pen and paper calculations. At the moment I mainly use a combination of triple-quoted strings, exec and print (Yes, I know it's not exactly elegant). To clarify, I just start an editor, wri

s-expression parser in python

2010-04-06 Thread James Stroud
Hello All, I want to use an s-expression based configuration file format for a python program I'm writing. Does anyone have a favorite parser? I'm currently using sexpy.parse() (http://pypi.python.org/pypi/sexpy) which works very well but I don't know how secure it is. Does anyone have exper

Re: Incorrect scope of list comprehension variables

2010-04-06 Thread Rolando Espinoza La Fuente
On Sun, Apr 4, 2010 at 5:20 PM, Paul Rubin wrote: [...] > >    d[r] = list(r for r in [4,5,6]) > This have a slightly performance difference. I think mainly the generator's next() call. In [1]: %timeit list(r for r in range(1)) 100 loops, best of 3: 2.78 ms per loop In [2]: %timeit [r for r

Re: Incorrect scope of list comprehension variables

2010-04-06 Thread Gregory Ewing
Lie Ryan wrote: in python there is only a flat local namespace and the names resolver becomes a thousand times simpler No, it doesn't. The compiler already has to deal with multiple scopes for nested functions. There may be some simplification, but not a lot. The main reason is linguistic. Hav

Re: python as pen and paper substitute

2010-04-06 Thread Chris Colbert
you may have a look at sage: http://www.sagemath.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: In disGuiodoise?

2010-04-06 Thread Andreas Waldenburger
On Mon, 05 Apr 2010 22:03:00 +0200 News123 wrote: > Andreas Waldenburger wrote: > > On Mon, 05 Apr 2010 13:48:15 +0200 News123 wrote: > > > >> Martin P. Hellwig wrote: > >>> On 04/05/10 00:05, r wrote: > >>> > However i have also considered that maybe *all* the "well knowns" > are in

Re: python as pen and paper substitute

2010-04-06 Thread Dave Angel
Johan Gr wrote: Manuel Graune skrev: Thanks for your reply. The output should 1) show manually selected python code and comments (whatever I think is important), 2) show selected results (final and intermediate) and 3) *not* show python code that for someone only interested in the calculati

Re: Simplify Python

2010-04-06 Thread Dave Angel
ja1lbr3ak wrote: I'm trying to teach myself Python, and so have been simplifying a calculator program that I wrote. The original was 77 lines for the same functionality. Problem is, I've hit a wall. Can anyone help? loop = input("Enter 1 for the calculator, 2 for the Fibonacci sequence, or somet

Re: python as pen and paper substitute

2010-04-06 Thread Johan Grönqvist
Manuel Graune skrev: Manuel Graune writes: Just as an additional example, let's assume I'd want to add the area of to circles. [...] which can be explained to anyone who knows basic math and is not at all interested in python. Third attempt. The markup now includes tagging of different parts

Re: Performance of list vs. set equality operations

2010-04-06 Thread Chris Colbert
:slaps forehead: good catch. On Tue, Apr 6, 2010 at 5:18 PM, Gustavo Narea wrote: > On Apr 6, 7:28 pm, Chris Colbert wrote: >> the proof is in the pudding: >> >> In [1]: a = range(1) >> >> In [2]: s = set(a) >> >> In [3]: s2 = set(a) >> >> In [5]: b = range(1) >> >> In [6]: a == b >> Ou

Re: Simplify Python

2010-04-06 Thread Joaquin Abian
On Apr 6, 11:04 pm, ja1lbr3ak wrote: > On Apr 6, 4:56 pm, Joaquin Abian wrote: > > > > > On Apr 6, 9:04 pm, ja1lbr3ak wrote: > > > > I'm trying to teach myself Python, and so have been simplifying a > > > calculator program that I wrote. The original was 77 lines for the > > > same functionality

Re: python as pen and paper substitute

2010-04-06 Thread Johan Grönqvist
Manuel Graune skrev: Thanks for your reply. The output should 1) show manually selected python code and comments (whatever I think is important), 2) show selected results (final and intermediate) and 3) *not* show python code that for someone only interested in the calculation and the results

Re: python as pen and paper substitute

2010-04-06 Thread Manuel Graune
Manuel Graune writes: > > The use-case is acually fairly simple. The point is to use a python > source-file as subsitute for scrap-paper (with the opportunity to > edit what is already written and without illegible handwriting). > The output should 1) show manually selected python code and commen

Re: python as pen and paper substitute

2010-04-06 Thread Manuel Graune
Manuel Graune writes: > > The use-case is acually fairly simple. The point is to use a python > source-file as subsitute for scrap-paper (with the opportunity to > edit what is already written and without illegible handwriting). > The output should 1) show manually selected python code and commen

Re: Performance of list vs. set equality operations

2010-04-06 Thread Gustavo Narea
On Apr 6, 7:28 pm, Chris Colbert wrote: > the proof is in the pudding: > > In [1]: a = range(1) > > In [2]: s = set(a) > > In [3]: s2 = set(a) > > In [5]: b = range(1) > > In [6]: a == b > Out[6]: True > > In [7]: s == s2 > Out[7]: True > > In [8]: %timeit a == b > 1000 loops, best of 3: 2

Re: Simplify Python

2010-04-06 Thread ja1lbr3ak
On Apr 6, 4:56 pm, Joaquin Abian wrote: > On Apr 6, 9:04 pm, ja1lbr3ak wrote: > > > > > > > I'm trying to teach myself Python, and so have been simplifying a > > calculator program that I wrote. The original was 77 lines for the > > same functionality. Problem is, I've hit a wall. Can anyone help

Re: python as pen and paper substitute

2010-04-06 Thread Manuel Graune
Thanks for your reply. Johan Grönqvist writes: > Manuel Graune skrev: >> To clarify, I just start an editor, write a file that >> might look something like this: >> >> -snip- >> code=""" >> a = 1 >> b = 2 >> c = 3 >> result = a + b >> """ >> exec(code) >> print(code) >> print("result

Re: Simplify Python

2010-04-06 Thread Joaquin Abian
On Apr 6, 9:04 pm, ja1lbr3ak wrote: > I'm trying to teach myself Python, and so have been simplifying a > calculator program that I wrote. The original was 77 lines for the > same functionality. Problem is, I've hit a wall. Can anyone help? > > loop = input("Enter 1 for the calculator, 2 for the F

Re: plotting in python 3

2010-04-06 Thread Rolf Camps
Op dinsdag 06-04-2010 om 14:55 uur [tijdzone -0500], schreef Christopher Choi: > On Tue, 06 Apr 2010 21:23:34 +0200, Rolf Camps wrote: > > > Hi, > > > > What's the easiest way to plot graphs in python 3.x? Ís there a package? > > Quality doesn't really matter. > > > > Thanks, > > > > Rolf > > H

Re: Simplify Python

2010-04-06 Thread ja1lbr3ak
On Apr 6, 4:17 pm, Christopher Choi wrote: > On Tue, 06 Apr 2010 13:14:44 -0700, ja1lbr3ak wrote: > > On Apr 6, 4:06 pm, Christopher Choi wrote: > >> On Tue, 06 Apr 2010 12:04:20 -0700, ja1lbr3ak wrote: > >> > I'm trying to teach myself Python, and so have been simplifying a > >> > calculator pro

Re: Python script error when using print

2010-04-06 Thread Pierre Quentel
On 6 avr, 20:14, "Albert W. Hopkins" wrote: > On Tue, 2010-04-06 at 08:38 -0700, Robbie wrote: > > Hi all, > > > So, I'm trying to use Python with an apache2 server to create some web > > pages.  The web server is configured and seems to work correctly, but > > only with a certain type of script.

Re: python as pen and paper substitute

2010-04-06 Thread Johan Grönqvist
Manuel Graune skrev: To clarify, I just start an editor, write a file that might look something like this: -snip- code=""" a = 1 b = 2 c = 3 result = a + b """ exec(code) print(code) print("result =\t", result) print("result + c =\t", result + c) -snip-- and feed thi

Re: Simplify Python

2010-04-06 Thread Christopher Choi
On Tue, 06 Apr 2010 13:14:44 -0700, ja1lbr3ak wrote: > On Apr 6, 4:06 pm, Christopher Choi wrote: >> On Tue, 06 Apr 2010 12:04:20 -0700, ja1lbr3ak wrote: >> > I'm trying to teach myself Python, and so have been simplifying a >> > calculator program that I wrote. The original was 77 lines for the

Re: passing command line arguments to executable

2010-04-06 Thread Bror Johansson
On 2010-04-03 18:09, mcanjo wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the input file, I hit enter, and then it asks me for and output filename, I hit enter

Re: Simplify Python

2010-04-06 Thread ja1lbr3ak
On Apr 6, 4:06 pm, Christopher Choi wrote: > On Tue, 06 Apr 2010 12:04:20 -0700, ja1lbr3ak wrote: > > I'm trying to teach myself Python, and so have been simplifying a > > calculator program that I wrote. The original was 77 lines for the same > > functionality. Problem is, I've hit a wall. Can an

Re: Impersonating a Different Logon

2010-04-06 Thread Tim Golden
On 06/04/2010 20:26, Kevin Holleran wrote: Hello, I am sweeping some of our networks to find devices. When I find a device I try to connect to the registry using _winreg and then query a specific key that I am interested in. This works great for machines that are on our domain, but there are l

Re: Simplify Python

2010-04-06 Thread Christopher Choi
On Tue, 06 Apr 2010 12:04:20 -0700, ja1lbr3ak wrote: > I'm trying to teach myself Python, and so have been simplifying a > calculator program that I wrote. The original was 77 lines for the same > functionality. Problem is, I've hit a wall. Can anyone help? > > loop = input("Enter 1 for the calcu

Re: plotting in python 3

2010-04-06 Thread Christopher Choi
On Tue, 06 Apr 2010 21:23:34 +0200, Rolf Camps wrote: > Hi, > > What's the easiest way to plot graphs in python 3.x? Ís there a package? > Quality doesn't really matter. > > Thanks, > > Rolf > Hi, > > What's the easiest way to plot graphs in python 3.x? Ís there a package? > Quality doesn't re

Re: per-method jit compiler

2010-04-06 Thread Irmen de Jong
On 6-4-2010 8:22, Luis M. González wrote: The above post gave me an idea (very naive, of couse). What if I write a simple decorator to figure out the types of every function, and then we use it as a base for a simple method-jit compiler for python? example: def typer(f): def wrap(*args):

plotting in python 3

2010-04-06 Thread Rolf Camps
Hi, What's the easiest way to plot graphs in python 3.x? Ís there a package? Quality doesn't really matter. Thanks, Rolf signature.asc Description: Dit berichtdeel is digitaal ondertekend -- http://mail.python.org/mailman/listinfo/python-list

Impersonating a Different Logon

2010-04-06 Thread Kevin Holleran
Hello, I am sweeping some of our networks to find devices. When I find a device I try to connect to the registry using _winreg and then query a specific key that I am interested in. This works great for machines that are on our domain, but there are left over machines that are stand alone and th

Simplify Python

2010-04-06 Thread ja1lbr3ak
I'm trying to teach myself Python, and so have been simplifying a calculator program that I wrote. The original was 77 lines for the same functionality. Problem is, I've hit a wall. Can anyone help? loop = input("Enter 1 for the calculator, 2 for the Fibonacci sequence, or something else to quit:

python as pen and paper substitute

2010-04-06 Thread Manuel Graune
Hello everyone, I am looking for ways to use a python file as a substitute for simple pen and paper calculations. At the moment I mainly use a combination of triple-quoted strings, exec and print (Yes, I know it's not exactly elegant). To clarify, I just start an editor, write a file that might lo

Re: Translation docstrings with gettext

2010-04-06 Thread Lie Ryan
On 04/06/10 19:52, sapient wrote: > Lie Ryan, thank you for your answer! >> Why would you want to translate docstring? Docstring is meant for >> developers not users. > I have mentioned that I want to provide API for existing image- > processing applicaion in Python. > In my case "developers" are "

Re: Recommend Commercial graphing library

2010-04-06 Thread Grant Edwards
On 2010-04-06, Duncan Booth wrote: > Grant Edwards wrote: > >> Seriously, most of the graphs I've seen in "presentations" would make >> Ed Tufte spin in his grave. > > http://flowingdata.com/2010/03/20/powerpoint-and-dying-kittens/ :) Years ago I was walking past a marketing guy's cube, and on

Re: Performance of list vs. set equality operations

2010-04-06 Thread Chris Colbert
the proof is in the pudding: In [1]: a = range(1) In [2]: s = set(a) In [3]: s2 = set(a) In [5]: b = range(1) In [6]: a == b Out[6]: True In [7]: s == s2 Out[7]: True In [8]: %timeit a == b 1000 loops, best of 3: 204 us per loop In [9]: %timeit s == s2 1 loops, best of 3: 124 us

Re: Recommend Commercial graphing library

2010-04-06 Thread Grant Edwards
On 2010-04-06, superpollo wrote: > Grant Edwards ha scritto: >> On 2010-04-06, Grant Edwards wrote: >>> On 2010-04-06, Jean-Michel Pichavant wrote: Pablo Recio Quijano wrote: > Why must be commercial, when there is open and free alternatives? Like > GNU Plot. Gnuplot is ugly.

Re: Recommend Commercial graphing library

2010-04-06 Thread Robert Kern
On 2010-04-06 11:44 AM, superpollo wrote: Grant Edwards ha scritto: On 2010-04-06, Grant Edwards wrote: On 2010-04-06, Jean-Michel Pichavant wrote: Pablo Recio Quijano wrote: Why must be commercial, when there is open and free alternatives? Like GNU Plot. Gnuplot is ugly. I'm using it beca

Performance of list vs. set equality operations

2010-04-06 Thread Gustavo Narea
Hello! Could you please confirm whether my understanding of equality operations in sets and lists is correct? This is how I think things work, partially based on experimentation and the online documentation for Python: When you compare two lists, *every* element of one of the lists is compared ag

Re: Python script error when using print

2010-04-06 Thread Albert W. Hopkins
On Tue, 2010-04-06 at 08:38 -0700, Robbie wrote: > Hi all, > > So, I'm trying to use Python with an apache2 server to create some web > pages. The web server is configured and seems to work correctly, but > only with a certain type of script. > > For instance, this script works fine > > #!/usr/

Re: Pickle problem while loading a class instance.

2010-04-06 Thread Lie Ryan
On 04/07/10 03:23, gerardob wrote: > The error below appears. In the case i remove the comment to initialize m2, > the same thing happens. Any ideas on how to fix this? > When unpickling a user-defined class, you unpickling module must have access to the original class definition. This means if

Re: Pickle problem while loading a class instance.

2010-04-06 Thread Peter Otten
gerardob wrote: > Hello, I am new to python and i have a problem using the pickle load > function. > I have an object m of the class MarkovModel and i want to copy it to a > file and load it onto another class: > > l=[1,2,3] > m = markov_model.MarkovModel() > m.load_observations(l) > file = open(

Re: pass object or use self.object?

2010-04-06 Thread Lie Ryan
On 04/06/10 23:52, Tim Arnold wrote: > Hi, > I have a few classes that manipulate documents. One is really a > process that I use a class for just to bundle a bunch of functions > together (and to keep my call signatures the same for each of my > manipulator classes). > > So my question is whether

imports again

2010-04-06 Thread Alex Hall
Sorry this is a forward (long story involving a braille notetaker's bad copy/paste and GMail's annoying mobile site). Basically, I am getting errors when I run the project at http://www.gateway2somewhere.com/sw.zip and I do not understand why. The bad line was working until I added more import stat

Pickle problem while loading a class instance.

2010-04-06 Thread gerardob
Hello, I am new to python and i have a problem using the pickle load function. I have an object m of the class MarkovModel and i want to copy it to a file and load it onto another class: l=[1,2,3] m = markov_model.MarkovModel() m.load_observations(l) file = open("prueba.txt", 'w') pickle.dump(m,f

Re: Is there a standard name for this tree structure?

2010-04-06 Thread egbert
On Sun, Apr 04, 2010 at 12:10:02PM +, Steven D'Aprano wrote: > I can implement this tree using a flat dict: > > root = object() > data = {root: ['Mammal', 'Reptile'], What is the advantage, or thougth behind, using an instance of object as the root of your flat tree ? egbert -- Egbert Bo

Re: Recommend Commercial graphing library

2010-04-06 Thread AlienBaby
I am just looking at the PSF license now as it goes. It does appear that we should be able to continue using matplotlib. - the restrictions on open-source that have been imposed specifically state it is fine to use the python language, and if matplotlib has the same license I personally can't see a

upcoming Python training in Florida, April 27-29

2010-04-06 Thread Mark Lutz
Greetings Python fans, Don't miss your chance to attend our upcoming Florida Python training seminar later this month. This 3-day public class will be held on April 27-29, in Sarasota, Florida. It is open to both individuals and groups. For more details on the class, as well as registration inst

Re: Recommend Commercial graphing library

2010-04-06 Thread Duncan Booth
Grant Edwards wrote: > Seriously, most of the graphs I've seen in "presentations" would make > Ed Tufte spin in his grave. http://flowingdata.com/2010/03/20/powerpoint-and-dying-kittens/ -- http://mail.python.org/mailman/listinfo/python-list

Re: (a==b) ? 'Yes' : 'No'

2010-04-06 Thread Duncan Booth
Albert van der Horst wrote: > Old hands would have ... > stamp =( weight>=1000 and 120 or > weight>=500 and 100 or > weight>=250 and 80 or > weight>=100 and 60 or >44 ) > > (Kind of a brain twister, I think, inf

Re: Python script error when using print

2010-04-06 Thread superpollo
Robbie ha scritto: Hi all, So, I'm trying to use Python with an apache2 server to create some web pages. The web server is configured and seems to work correctly, but only with a certain type of script. For instance, this script works fine #!/usr/bin/env python def index(): s = "Hello Wor

Re: Recommend Commercial graphing library

2010-04-06 Thread superpollo
Grant Edwards ha scritto: On 2010-04-06, Grant Edwards wrote: On 2010-04-06, Jean-Michel Pichavant wrote: Pablo Recio Quijano wrote: Why must be commercial, when there is open and free alternatives? Like GNU Plot. Gnuplot is ugly. I'm using it because I don't care if it's ugly but it clearl

Re: Recommend Commercial graphing library

2010-04-06 Thread Michael Torrie
On 04/06/2010 10:05 AM, AlienBaby wrote: > The requirement for a commercial license comes down to being > restricted to not using any open source code. If it's an open source > license it can't be used in our context. Python itself and all its standard libraries are open source, under the PSF lice

Re: Incorrect scope of list comprehension variables

2010-04-06 Thread Stephen Hansen
On 2010-04-06 09:34:04 -0700, Lie Ryan said: in python there is only a flat local namespace and the names resolver becomes a thousand times simpler (and faster). This hasn't been true for a long time. Yes, local variables are optimized to be indexed in an array, but Python has nested scopes f

Re: Recommend Commercial graphing library

2010-04-06 Thread Benjamin Kaplan
On Tue, Apr 6, 2010 at 9:05 AM, AlienBaby wrote: > On Apr 6, 4:24 pm, Jean-Michel Pichavant > wrote: >> Pablo Recio Quijano wrote: >> > Why must be commercial, when there is open and free alternatives? Like >> > GNU Plot. >> >> Gnuplot is ugly. I'm using it because I don't care if it's ugly but i

Re: Translation docstrings with gettext

2010-04-06 Thread Gabriel Genellina
En Tue, 06 Apr 2010 06:52:57 -0300, sapient escribió: Lie Ryan, thank you for your answer! Why would you want to translate docstring? Docstring is meant for developers not users. I have mentioned that I want to provide API for existing image- processing applicaion in Python. In my case "dev

Re: Recommend Commercial graphing library

2010-04-06 Thread Grant Edwards
On 2010-04-06, Grant Edwards wrote: > On 2010-04-06, Jean-Michel Pichavant wrote: >> Pablo Recio Quijano wrote: >>> Why must be commercial, when there is open and free alternatives? Like >>> GNU Plot. >> >> Gnuplot is ugly. I'm using it because I don't care if it's ugly but it >> clearly lacks

Re: Recommend Commercial graphing library

2010-04-06 Thread Paul McGuire
On Apr 6, 11:05 am, AlienBaby wrote: > The requirement for a commercial license comes down to being > restricted to not using any open source code. If it's an open source > license it can't be used in our context. You may be misunderstanding this issue, I think you are equating "open source" with

Re: Recommend Commercial graphing library

2010-04-06 Thread Ed Keith
--- On Tue, 4/6/10, AlienBaby wrote: > From: AlienBaby > Subject: Re: Recommend Commercial graphing library > To: python-list@python.org > Date: Tuesday, April 6, 2010, 12:05 PM > On Apr 6, 4:24 pm, Jean-Michel > Pichavant > wrote: > > Pablo Recio Quijano wrote: > > > Why must be commercial, wh

Re: Recommend Commercial graphing library

2010-04-06 Thread Grant Edwards
On 2010-04-06, Jean-Michel Pichavant wrote: > Pablo Recio Quijano wrote: >> Why must be commercial, when there is open and free alternatives? Like >> GNU Plot. > > Gnuplot is ugly. I'm using it because I don't care if it's ugly but it > clearly lacks of look & feel for presentations, as requeste

Re: Recommend Commercial graphing library

2010-04-06 Thread AlienBaby
On Apr 6, 4:24 pm, Jean-Michel Pichavant wrote: > Pablo Recio Quijano wrote: > > Why must be commercial, when there is open and free alternatives? Like > > GNU Plot. > > Gnuplot is ugly. I'm using it because I don't care if it's ugly but it > clearly lacks of look & feel for presentations, as requ

Re: per-function jit compiler

2010-04-06 Thread Gabriel Genellina
En Tue, 06 Apr 2010 07:23:19 -0300, Luis M. González escribió: On 6 abr, 03:40, Chris Rebert wrote: 2010/4/5 Luis M. González : > This post gave me an idea:http://groups.google.com/group/comp.lang.python/msg/5d75080707104b76 > What if I write a simple decorator to figure out the ty

Re: (a==b) ? 'Yes' : 'No'

2010-04-06 Thread Lie Ryan
On 04/07/10 00:16, Albert van der Horst wrote: > In article , > Peter Otten <__pete...@web.de> wrote: >> Pierre Quentel wrote: >> >>> I'm surprised nobody proposed a solution with itertools ;-) >> >> next(itertools.takewhile(lambda _: a == b, ["yes"]), "no") > > I could learn something here, if y

Python script error when using print

2010-04-06 Thread Robbie
Hi all, So, I'm trying to use Python with an apache2 server to create some web pages. The web server is configured and seems to work correctly, but only with a certain type of script. For instance, this script works fine #!/usr/bin/env python def index(): s = "Hello World" return s But

Re: Incorrect scope of list comprehension variables

2010-04-06 Thread Lie Ryan
On 04/06/10 18:42, Alain Ketterlin wrote: > Alain Ketterlin writes: > >> d = dict() >> for r in [1,2,3]: >> d[r] = [r for r in [4,5,6]] >> print d > > Thanks to Chris and Paul for the details (the list comp. r actually > leaks). I should have found this by myself. > > My background is more

Re: pass object or use self.object?

2010-04-06 Thread Xavier Ho
On Wed, Apr 7, 2010 at 1:19 AM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Usually, when using classes as namespace, functions are declared as static > (or as classmethod if required). > e.g. > > > class Foo: > @classmethod > def process(cls, document): > print 'process of'

Re: per-method jit compiler

2010-04-06 Thread Florian Ludwig
On Mon, 2010-04-05 at 22:45 -0700, Luis M. González wrote: > The above post gave me an idea (very naive, of couse). > What if I write a simple decorator to figure out the types of every > function, and then we use it as a base for a simple method-jit > compiler for python? I think its what done be

Re: Recommend Commercial graphing library

2010-04-06 Thread Jean-Michel Pichavant
Pablo Recio Quijano wrote: Why must be commercial, when there is open and free alternatives? Like GNU Plot. Gnuplot is ugly. I'm using it because I don't care if it's ugly but it clearly lacks of look & feel for presentations, as requested by the OP. You have http://matplotlib.sourceforge.ne

Re: pass object or use self.object?

2010-04-06 Thread Jean-Michel Pichavant
Tim Arnold wrote: Hi, I have a few classes that manipulate documents. One is really a process that I use a class for just to bundle a bunch of functions together (and to keep my call signatures the same for each of my manipulator classes). So my question is whether it's bad practice to set thing

Re: Recommend Commercial graphing library

2010-04-06 Thread Pablo Recio Quijano
Why must be commercial, when there is open and free alternatives? Like GNU Plot. 2010/4/6 AlienBaby > Hi, > > I'm on the hunt for a good quality commercially licensed graphing / > plotting library and wondered if anyone here had any recomendations. > The work to be done is less scientific, more

Re: pass object or use self.object?

2010-04-06 Thread Bruno Desthuilliers
Tim Arnold a écrit : Hi, I have a few classes that manipulate documents. One is really a process that I use a class for just to bundle a bunch of functions together (and to keep my call signatures the same for each of my manipulator classes). So my question is whether it's bad practice to set th

Recommend Commercial graphing library

2010-04-06 Thread AlienBaby
Hi, I'm on the hunt for a good quality commercially licensed graphing / plotting library and wondered if anyone here had any recomendations. The work to be done is less scientific, more presentational, (I'm not going to be dealing with heatmaps / vectors etc.., just the usual bar / line / bubble /

Re: sum for sequences?

2010-04-06 Thread Neil Cerutti
On 2010-04-06, Albert van der Horst wrote: > To a mathematician sum(set) suggest that the order of summation > doesn't matter. (So I wouldn't use sum for concatenating > lists.) Harshly, sum() should be used only for operator + both > associative and commutative. > > Now for floating point numbers

Re: (a==b) ? 'Yes' : 'No'

2010-04-06 Thread Albert van der Horst
In article , Steve Holden wrote: >kj wrote: >> In Steve Holden >> writes: >> >>> John Nagle wrote: Chris Rebert wrote: > On Tue, Mar 30, 2010 at 8:40 AM, gentlestone > wrote: >> Hi, how can I write the popular C/JAVA syntax in Python? >> >> Java example: >>ret

Re: sum for sequences?

2010-04-06 Thread Patrick Maupin
On Apr 6, 8:39 am, Albert van der Horst wrote: > To a mathematician sum(set) suggest that the order of summation > doesn't matter. (So I wouldn't use sum for concatenating lists.) > Harshly, sum() should be used only for operator + both associative and > commutative. That's all well and good, bu

Re: pass object or use self.object?

2010-04-06 Thread Xavier Ho
> So my question is whether it's bad practice to set things up so each > method operates on self.document or should I pass document around from > one function to the next? > I think this depends on the use case. If the functions you're calling in between have a chance to be called independently,

  1   2   >