Re: Python fails on math

2011-02-22 Thread David C. Ullrich
2.0 * e * sqrt(3.0) - 2.0 * e > 3.9798408154464964 > > #2: > >>> 2.0 * e * (sqrt(3.0) -1.0) > 3.979840815446496 > > I was wondering what exactly is failing here. The math module? Python, > or the IEEE specifications? > > -- -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: a splitting headache

2009-10-22 Thread David C . Ullrich
On Wed, 21 Oct 2009 14:43:48 -0700 (PDT), Mensanator wrote: >On Oct 21, 2:46 pm, David C Ullrich wrote: >> On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: >> > On Oct 20, 1:51 pm, David C Ullrich wrote: >> >> On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator

Re: a splitting headache

2009-10-22 Thread David C . Ullrich
On Wed, 21 Oct 2009 14:43:48 -0700 (PDT), Mensanator wrote: >On Oct 21, 2:46 pm, David C Ullrich wrote: >> On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: >> > On Oct 20, 1:51 pm, David C Ullrich wrote: >> >> On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator

Re: a splitting headache

2009-10-22 Thread David C . Ullrich
On Wed, 21 Oct 2009 22:47:24 -0700 (PDT), Carl Banks wrote: >On Oct 21, 12:46 pm, David C Ullrich wrote: >> On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: >> > On Oct 20, 1:51 pm, David C Ullrich wrote: >> > I'm not saying either behaviour is wrong

Re: a splitting headache

2009-10-21 Thread David C Ullrich
On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: > On Oct 20, 1:51 pm, David C Ullrich wrote: >> On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator wrote: >> > All I wanted to do is split a binary number into two lists, a list of >> > blocks of consecutive ones an

Re: a splitting headache

2009-10-20 Thread David C Ullrich
On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator wrote: > All I wanted to do is split a binary number into two lists, a list of > blocks of consecutive ones and another list of blocks of consecutive > zeroes. > > But no, you can't do that. > c = '001110' c.split('0') > ['', '', '1',

Re: list to tuple and vice versa

2009-10-20 Thread David C Ullrich
On Sun, 18 Oct 2009 14:33:17 +1100, Ben Finney wrote: > Jabba Laci writes: > >> Hi, >> >> I have some difficulties with list -> tuple conversion: >> >> t = ('a', 'b') >> li = list(t) # tuple -> list, works print li # ['a', 'b'] >> >> tu = tuple(li) # list -> tuple, error print tu # what

Re: for loop: range() result has too many items

2009-10-15 Thread David C . Ullrich
On Wed, 14 Oct 2009 01:54:44 -0700 (PDT), Mark Dickinson wrote: >On Oct 13, 10:39 pm, Steven D'Aprano > wrote: >> On Tue, 13 Oct 2009 16:17:58 -0500, Peng Yu wrote: >> > Hi, >> >> > The following code does not run because range() does not accept a big >> > number. >> >> Incorrect. >> >> >>> range

Re: The rap against "while True:" loops

2009-10-12 Thread David C Ullrich
kj wrote: I'm coaching a group of biologists on basic Python scripting. One of my charges mentioned that he had come across the advice never to use loops beginning with "while True". Of course, that's one way to start an infinite loop, Heh-heh: When I read this it occurred to me that another

Re: easy question, how to double a variable

2009-09-23 Thread David C Ullrich
On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote: > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote: > >> But you actually want to return twice the value. I don't see how to do >> that. > > What? > > Seriously? You're saying it

Re: easy question, how to double a variable

2009-09-21 Thread David C Ullrich
On Sun, 20 Sep 2009 13:27:07 -0700, daggerdvm wrote: > Write the definition of a function twice , that receives an int > parameter and returns an int that is twice the value of the parameter. > > how can i do this I don't think this can be done in Python. Looking at the Subject line I though

Re: str.split() with empty separator

2009-09-17 Thread David C Ullrich
On Tue, 15 Sep 2009 14:31:26 +0200, Ulrich Eckhardt wrote: > Hi! > > "'abc'.split('')" gives me a "ValueError: empty separator". However, > "''.join(['a', 'b', 'c'])" gives me "'abc'". > > Why this asymmetry? The docs say "If sep is given, consecutive delimiters are not grouped together and a

Re: Q on explicitly calling file.close

2009-09-10 Thread David C . Ullrich
en you _always_ have to check the return value of egor_read_file and take appropriate action - complicates the code everywhere the function is called as well as making the function more complicated. Doing it as in UseResource() above you don't need to worry about whether UseResource() failed _excep

Re: Q on explicitly calling file.close

2009-09-09 Thread David C Ullrich
On Sat, 05 Sep 2009 23:41:08 +, Steven D'Aprano wrote: > On Sat, 05 Sep 2009 16:14:02 +, kj wrote: > >> Finally, I was under the impression that Python closed filehandles >> automatically when they were garbage-collected. [...] > > (3) For quick and dirty scripts, or programs that only u

Re: Video?

2009-09-04 Thread David C . Ullrich
On Thu, 3 Sep 2009 16:24:44 -0700 (PDT), Che M wrote: >On Sep 3, 4:11 pm, David C Ullrich wrote: >> Not at all important, just for fun (at least for me): >> >> It seems to me, looking at various docs, that wxWidgets >> includes a "media control" that

Re: Video?

2009-09-04 Thread David C . Ullrich
On Thu, 03 Sep 2009 23:04:45 +0200, Avell Diroll wrote: >David C Ullrich wrote: >... >> Is that correct? If so is there some other standard Python >> windowing kit that does include some sort of video functionality? >> >> (Talking Ubuntu Linux if it matters.) &

Video?

2009-09-03 Thread David C Ullrich
Not at all important, just for fun (at least for me): It seems to me, looking at various docs, that wxWidgets includes a "media control" that can play video files, but it's not included in wxPython. (There's something in wxPython with a promising name but it seems to be just audio.) Is that corre

Re: Permanently adding to the Python path in Ubuntu

2009-09-01 Thread David C. Ullrich
in wing-ide. > > Is there a way to fix this so that the local dist-packages is added to > sys.path before the system directory ALWAYS? I can do this by editing > site.py but I think it's kind of bad form to do it this way. I feel > there has to be a way to do this without

Re: Python for professsional Windows GUI apps?

2009-08-26 Thread David C Ullrich
On Mon, 24 Aug 2009 22:22:20 -0700, sturlamolden wrote: > On 25 Aug, 05:56, Peter Decker wrote: > >> I use the Dabo Class Designer to visually design my forms. So what's >> you're point?  :) > > Nothing, except lobbying for wxFormBuilder for anyone who still doesn't > know of it. :) That's gre

Re: Silly question

2009-08-21 Thread David C . Ullrich
On Fri, 21 Aug 2009 14:45:55 -0500, David C Ullrich wrote: >[...] > >Oops. Should have tested that a little more carefully >before posting. No time to fix it right now, customer just >got here. Let's just say we're looking for the primes >between sqrt(n) and n...

Re: Silly question

2009-08-21 Thread David C Ullrich
On Fri, 21 Aug 2009 14:40:30 -0500, David C Ullrich wrote: > On Thu, 20 Aug 2009 16:51:00 -0700, Aahz wrote: > >> In article , >> Benjamin Kaplan wrote: >>>On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrich >>>wrot= e: >>>> >>>> I ju

Re: Silly question

2009-08-21 Thread David C Ullrich
On Thu, 20 Aug 2009 16:51:00 -0700, Aahz wrote: > In article , > Benjamin Kaplan wrote: >>On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrich >>wrot= e: >>> >>> I just noticed that >>> sequence[i:j:k] >> >>Well, I got some good news and some

Re: Silly question

2009-08-21 Thread David C Ullrich
On Thu, 20 Aug 2009 17:45:11 -0700, John Machin wrote: > On Aug 21, 5:33 am, David C Ullrich wrote: > >> So I'm slow, fine. (There were several times when I was using 1.5.3 and >> wished they were there - transposing matrices, etc.) > > 1.5.THREE ?? Not sure.

Re: Silly question

2009-08-20 Thread David C Ullrich
On Thu, 20 Aug 2009 14:36:35 -0400, Benjamin Kaplan wrote: > On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrich > wrote: >> I just noticed that >> >>  sequence[i:j:k] >> >> syntax in a post here. When did this happen? >> >> (I'm just curious

Re: Silly question

2009-08-20 Thread David C Ullrich
On Thu, 20 Aug 2009 18:41:34 +, Duncan Booth wrote: > David C Ullrich wrote: > >> I just noticed that >> >> sequence[i:j:k] >> >> syntax in a post here. When did this happen? >> >> (I'm just curious whether it existed in 1.5.x or no

Silly question

2009-08-20 Thread David C Ullrich
I just noticed that sequence[i:j:k] syntax in a post here. When did this happen? (I'm just curious whether it existed in 1.5.x or not. If so I'm stupid - otoh if it was introduced in 2.x I'm just slow...) -- http://mail.python.org/mailman/listinfo/python-list

Komodo(!)

2009-08-14 Thread David C Ullrich
Probably this isn't news to anyone but me, but just in case: Last I heard Komodo was a very highly regarded IDE that unfortunately cost money. Yesterday I discovered that they now have an editor available for free. Doesn't contain all the features of the IDE, but just having glanced at it it seem

Re: trouble with reload

2009-08-13 Thread David C Ullrich
On Thu, 13 Aug 2009 12:05:26 -0700, Dr. Phillip M. Feldman wrote: > According to the Python documentation, 'reload' reloads a previously > imported module (so that changes made via an external editor will be > effective). But, when I try to use this command, I get the following > error message: >

Re: Scraping Wikipedia with Python

2009-08-11 Thread David C Ullrich
On Tue, 11 Aug 2009 21:29:40 +0300, Dotan Cohen wrote: >>    Wikipedia has an API for computer access.  See >> >>        http://www.mediawiki.org/wiki/API >> >> > Yes, I am aware of this as well. Does anyone know of a python class for > easily interacting with it, or do I need to roll my own. Try

Re: how to use "exec" stmt to get input from user

2009-08-10 Thread David C Ullrich
What you're trying to do and what's not working isn't entirely clear to me. But if I had a wxPython application and I wanted to execute user input (note the _if_) I'd just pop up a window (I forget how "ShowModal" is spelled in wx right now) with a text box and an Execute button and a Cancel butt

Re: Measuring Fractal Dimension ?

2009-06-22 Thread David C . Ullrich
On Fri, 19 Jun 2009 12:40:36 -0700 (PDT), Mark Dickinson wrote: >On Jun 19, 7:43 pm, David C. Ullrich wrote: >> Evidently my posts are appearing, since I see replies. >> I guess the question of why I don't see the posts themselves >> \is ot here... > >Judging b

Re: Measuring Fractal Dimension ?

2009-06-22 Thread David C . Ullrich
On Mon, 22 Jun 2009 10:31:26 -0400, Charles Yeomans wrote: > >On Jun 22, 2009, at 8:46 AM, pdpi wrote: > >> On Jun 19, 8:13 pm, Charles Yeomans wrote: >>> On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote: >>> >>> >>> >>> >>&

Re: Measuring Fractal Dimension ?

2009-06-22 Thread David C . Ullrich
On Mon, 22 Jun 2009 05:46:55 -0700 (PDT), pdpi wrote: >On Jun 19, 8:13 pm, Charles Yeomans wrote: >> On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote: >> >> >> >> >> >> > Evidently my posts are appearing, since I see replies. >> > I g

Re: Measuring Fractal Dimension ?

2009-06-19 Thread David C . Ullrich
On Wed, 17 Jun 2009 05:46:22 -0700 (PDT), Mark Dickinson wrote: >On Jun 17, 1:26 pm, Jaime Fernandez del Rio >wrote: >> On Wed, Jun 17, 2009 at 1:52 PM, Mark Dickinson wrote: >> > Maybe James is thinking of the standard theorem >> > that says that if a sequence of continuous functions >> > on an

Re: Measuring Fractal Dimension ?

2009-06-19 Thread David C . Ullrich
Evidently my posts are appearing, since I see replies. I guess the question of why I don't see the posts themselves \is ot here... On Thu, 18 Jun 2009 17:01:12 -0700 (PDT), Mark Dickinson wrote: >On Jun 18, 7:26 pm, David C. Ullrich wrote: >> On Wed, 17 Jun 2009 08:18:52 -07

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 08:18:52 -0700 (PDT), Mark Dickinson wrote: >On Jun 17, 3:46 pm, Paul Rubin wrote: >> Mark Dickinson writes: >> > It looks as though you're treating (a portion of?) the Koch curve as >> > the graph of a function f from R -> R and claiming that f

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 07:37:32 -0400, Charles Yeomans wrote: > >On Jun 17, 2009, at 2:04 AM, Paul Rubin wrote: > >> Jaime Fernandez del Rio writes: >>> I am pretty sure that a continuous sequence of >>> curves that converges to a continuous curve, will do so uniformly. >> >> I think a typical exam

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 07:35:35 +0200, Jaime Fernandez del Rio wrote: >On Wed, Jun 17, 2009 at 4:50 AM, Lawrence >D'Oliveiro wrote: >> In message <7x63ew3uo9@ruckus.brouhaha.com>,  wrote: >> >>> Lawrence D'Oliveiro writes: >>> I don't think any countable set, even a countably-infinite set,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <7x63ew3uo9@ruckus.brouhaha.com>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <7x63ew3uo9@ruckus.brouhaha.com>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <7x63ew3uo9@ruckus.brouhaha.com>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-16 Thread David C . Ullrich
On 15 Jun 2009 04:55:03 GMT, Steven D'Aprano wrote: >On Sun, 14 Jun 2009 14:29:04 -0700, Kay Schluehr wrote: > >> On 14 Jun., 16:00, Steven D'Aprano >> wrote: >> >>> Incorrect. Koch's snowflake, for example, has a fractal dimension of >>> log 4/log 3 ? 1.26, a finite area of 8/5 times that of t

Re: SoHo Book Problem

2009-04-08 Thread David C. Ullrich
mewhere where Google can see it... DU. In article , "David C. Ullrich" wrote: > Just curious - has anyone else bought the printed > Python 3 Reference Manual published by SoHo Books? > > Talking about what they call "Part 2" of their Python > Documentation. I

SoHo Book Problem

2009-04-07 Thread David C. Ullrich
- that would mean nobody even _glanced_ at what was coming out of the press. So I'm curious whether anyone else has a copy. (I know it's all online. Some people like _books_...) DU. -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Introducing Python to others

2009-04-02 Thread David C. Ullrich
In article , "andrew cooke" wrote: > David C. Ullrich wrote: > > In article , > > Scott David Daniels wrote: [...] > >> > >> class Vector(list): > >> def __add__(self, other): > >> return type(self)(x + y

Re: Introducing Python to others

2009-03-31 Thread David C. Ullrich
lf, other): > return type(self)(x - y for x, y in zip(self, other)) > def __repr__(self): > return '%s(%s)' % ( > type(self).__name__, list.__repr__(self)) > > x = Vector([1,2]) > x + x + x > > --Scott David Daniels > scott.dani...@acm.org -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Introducing Python to others

2009-03-31 Thread David C. Ullrich
In article <039360fb-a29c-4f43-b6e0-ba97fb598...@z23g2000prd.googlegroups.com>, Mensanator wrote: > On Mar 26, 11:42 am, "andrew cooke" wrote: > > David C. Ullrich wrote: > > > In article , > > >  "Paddy O'Loughlin" wrote: > &

Re: Introducing Python to others

2009-03-26 Thread David C. Ullrich
evs, what should I use? CherryPy (seems to be the easiest), > Django (seems to be the "biggest"/most used), or something else? > > Any other suggestions for a possible "wow" reaction from an audience like > that? > > Thanks, > Paddy -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2008-12-02 Thread David C. Ullrich
mainmain = double(main) I left off the final parentheses because I didn't want to call mainmain just then, I just wanted to set mainmain to the right thing. > Thanks ! -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: etymology of "list comprehension"?

2008-11-11 Thread David C. Ullrich
ements of a given set S. Writing informally people often omit the "in S" part when the S in clear from the context. For example, your original {p | p is prime} should officially be {p in N | p is prime}, where N is the set of natural numbers - the first form is often written because the &qu

Re: default value in __init__

2008-10-21 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Oct 14, 1:36 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > > >[...] > > > In particular default parameters should work the way the user > > expects! The fac

Re: default value in __init__

2008-10-16 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > David C. Ullrich a écrit : > > In article <[EMAIL PROTECTED]>, > > Bruno Desthuilliers <[EMAIL PROTECTED]> > > wrote: > > > >> David C. Ullrich a é

Re: Question

2008-10-14 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "Aditi Meher" <[EMAIL PROTECTED]> wrote: > Hello > > How to write code to store data into buffer using python? buffer = data > Please reply. -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: default value in __init__

2008-10-14 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > David C. Ullrich a écrit : > > In article > > <[EMAIL PROTECTED]>, > > kenneth <[EMAIL PROTECTED]> wrote: > > > >> On Oct 9, 10:14 am, Christian Heime

Re: default value in __init__

2008-10-09 Thread David C. Ullrich
27;s a _bold face_ statement "Default parameter values are evaluated when the function definition is executed.", followed by an explanation of how that can lead to the sort of problem above. So I guess it _is_ awfully dangerous. They should really explain this aspect of the language's behavior to people who don't read the formal definition and also don't work through the tutorial. > Paolo -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: max(), sum(), next()

2008-09-09 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 05 Sep 2008 10:22:22 -0500, David C. Ullrich wrote about why max > and min shouldn't accept a default argument: > > > Think about all the previously elected female or blac

Re: max(), sum(), next()

2008-09-09 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > David C. Ullrich: > > I didn't mention what's below because it doesn't seem > > likely that saying max([]) = -infinity and > > min([]) = +infinity is going to make the OP happy... >

Re: max(), sum(), next()

2008-09-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > David C. Ullrich: > > At least in mathematics, the sum of the elements of > > the empty set _is_ 0, while the maximum element of the > > empty set is undefined. > > What do you think about my idea of

Re: max(), sum(), next()

2008-09-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Ken Starks <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > > > I don't see why you feel the two should act the same. > > At least in mathematics, the sum of the elements of > > the empty set _is_ 0, wh

Re: max(), sum(), next()

2008-09-04 Thread David C. Ullrich
lternative is to add a default to max(), like the next() > built-in of Python 2.6: > > >>> max((fun(x) for x in iterable if predicate(x)), default=smallvalue) > > This returns smallvalue if there are no items to compute the max of. > > Bye, > bearophile -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: max(), sum(), next()

2008-09-04 Thread David C. Ullrich
> > value = sum(L) > > else: > > value = 0 > > > > instead of sum(L). > > > > Once again, this is what sum() is used for in most cases, so this > > behavior is the "expected" one. > > > > Another argument to convince you: the sum() function in SQL for empty > > row sets returns zero in most relational databases. > > > > But of course it could have been implemented in a different way... I > > believe that there have been excessive discussions about this decision, > > and the current implementation is very good, if not the best. > > > > Best, > > > > Laszlo -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Function decorators

2008-09-04 Thread David C. Ullrich
"__main__": a = FoodList("eggs", "potatoes") print a > Thank you, > Aigars- > [Image] -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython beginners problem

2008-08-16 Thread David C. Ullrich
in python IDLE just the line > === restart === > shows up. > > How can I keep the window to "stay alive" so I see what I get ? > I'm on a winxp platform using python 2.5.2. if that matters. > > Please, any help, constructive advice and ideas are very much > appreciated. > > Best regards > Ivan Reborin -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: You advice please

2008-08-13 Thread David C. Ullrich
Lua, leading to Python in LuaTeX: http://labix.org/lunatic-python http://wiki.contextgarden.net/User:Luigi.scarso#Luatex_examples -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Inquisitive computing

2008-08-13 Thread David C. Ullrich
If you look at the end of the article you see the author agrees (I don't quite follow his complaint about not feeling at home with the interactive mode, but it's funny to read about how he uses Lisp but realizes he's not going to talk people into that...) > Bye, > bearophile -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread David C. Ullrich
t; I have to admit that I don't know how to clearly explain to her the > differences between these results. > Could someone please help us understand these difference between > Python and Perl ? > > Thanks in advance, > P4|1ndr0m -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Psycho question

2008-08-11 Thread David C. Ullrich
pypy, and I'd like to keep using Psyco... I feel the same way. Maybe someone will do it... (I wonder how much work it would be to make something like Psyco that only accepts a small subset of the language.) > Bye, > bearophile -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Psycho question

2008-08-08 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > f: 0.0158488750458 > > g: 0.000610113143921 > > h: 0.00200295448303 > > f: 0.0184948444366 > > g: 0.000257015228271 >

Re: Psycho question

2008-08-07 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, MRAB <[EMAIL PROTECTED]> wrote: > On Aug 6, 8:52 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > > In article > > <[EMAIL PROTECTED]>, > > > > [EMAIL PROTECTED] wrote: > > > David

Re: Psycho question

2008-08-07 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Erik Max Francis <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > Thanks. I would have guessed that I'd want low-level style code; > > that's the sort of thing I have in mind. In fact the only thing > > tha

Re: Psycho question

2008-08-06 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > > > David C. Ullrich: > > > Thanks. If I can get it installed and it works as advertised

Re: Psycho question

2008-08-06 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > David C. Ullrich: > > Thanks. If I can get it installed and it works as advertised > > this means I can finally (eventually) finish the process of > > dumping MS Windows: the only reason I need it right now

Re: Psycho question

2008-08-06 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Erik Max Francis <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > Just heard about Psycho. I've often wondered why someone > > doesn't make something that does exactly what Psycho does - keen. > > >

Psycho question

2008-08-05 Thread David C. Ullrich
not using Psycho is absolutely unaffected)? Thanks, -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: proposal, change self. to .

2008-08-05 Thread David C. Ullrich
demonstrated around a week ago. Read that, and rethink. > > > > --- Heiko. > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.9 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkiVqEcACgkQLMI5fndAv9j8KgCgmS2e+bTOT+sUPLYhtHBOVlyq > kxwAn028YSOGYGB4RyHZxYq6n4+tsSd+ > =vH9d > -END PGP SIGNATURE- -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL (etc etc etc) on OS X

2008-08-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Irmen de Jong <[EMAIL PROTECTED]> wrote: > > > David C. Ullrich wrote: > > > Decided to try to install PIL on my Mac (OS X

Re: PIL (etc etc etc) on OS X

2008-08-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Irmen de Jong <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > Just as well that the message sent earlier today > > seems to have been lost... > > > > Ok. Read your instructions on libjpeg. Read some > > of t

Re: PIL (etc etc etc) on OS X

2008-08-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Kevin Walzer <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > Just as well that the message sent earlier today > > seems to have been lost... > > > > Ok. Read your instructions on libjpeg. Read some > > of t

Re: PIL (etc etc etc) on OS X

2008-08-04 Thread David C. Ullrich
ature.jpeg = "libjpeg" # alternative name Not knowing exactly what "find_library_file" does I couldn't say, but it almost sounds like it's looking for a file named "jpeg". The summary from the jpeg install looks like it didn't install any such file. Maybe "jpeg" should be the name of one of those files that did get installed? This _is_ fun. Eech. DU. -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL (etc etc etc) on OS X

2008-08-04 Thread David C. Ullrich
Thanks for the hand-holding. DU. In article <[EMAIL PROTECTED]>, Kevin Walzer <[EMAIL PROTECTED]> wrote: > > [more about installing libjpeg...] -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL (etc etc etc) on OS X

2008-08-02 Thread David C. Ullrich
n a sufficiently invalid DOS exe could cause physical damage to a hard drive... that wasn't the only thing I learned that day. (Probably won't get back to this til Monday, btw, in case you say something and I don't seem interested.) DU. In article <[EMAIL PROTECTED]>, Kevin W

Re: PIL (etc etc etc) on OS X

2008-08-02 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Irmen de Jong <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > Decided to try to install PIL on my Mac (OS X.5). > > > > I know nothing about installing programs on Linux, > > nothing about building C programs,

Re: mapping a string to an instancemethod

2008-08-01 Thread David C. Ullrich
hello2', p def dispatch(self, func, p): func(self,p) def dispatch_as_string(self, funcname, p): getattr(self, funcname)(p) f = Foo() f.dispatch_as_string('hello1', 'world') > Many TIA and apologies if this is a FAQ, I googled and couldn't > find the answer. -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

PIL (etc etc etc) on OS X

2008-08-01 Thread David C. Ullrich
OError: decoder jpeg not available 1 items had failures: 1 of 57 in selftest.testimage ***Test Failed*** 1 failures. *** 1 tests of 57 failed. -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance and __getattr__

2008-07-29 Thread David C. Ullrich
stops there is that a __getattr__ was _found_. In the code below the lookup is not continuing, there's a _second_ lookup started by the request for super.__getattr__. > You'd need to > explicitely call on superclass instead to have B.__getattr__ called, ie: > > class A(object): > def __getattr__(self, name): > if name == 'a': > return 1 > return super(A, self).__getattr__(name) > > class B(object): > def __getattr__(self, name): > if name == 'b': > return 2 > return super(B, self).__getattr__(name) > > class C(A, B): > pass > -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance and __getattr__

2008-07-28 Thread David C. Ullrich
have them you really can't tell what's going to happen with c.__getattr__ unless you look at all the code in all the subclasses. > Since A and B are not written by me I can only work on C. The solution that > comes to my mind is to define a __getattr__ also in C and write somethi

Re: repr(string)

2008-07-25 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, MRAB <[EMAIL PROTECTED]> wrote: > On Jul 23, 4:04 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > > I've been saving data in a file with one line per field. > > Now some of the fields may become multi-line stri

Re: repr(string)

2008-07-24 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Peter Otten <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > In article <[EMAIL PROTECTED]>, > > Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > >> David C. Ullrich wrote: > >> > >

Re: repr(string)

2008-07-24 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > David C. Ullrich skrev: > > >> just keep in mind that using eval() on untrusted data isn't a very good > >> idea. > > > > Right. This data comes from me, gets put

Re: repr(string)

2008-07-24 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > I've been saving data in a file with one line per field. > > Now some of the fields may become multi-line strings... > > > > I was about to

repr(string)

2008-07-23 Thread David C. Ullrich
ot to contain line breaks? -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Written in C?

2008-07-21 Thread David C. Ullrich
gt; > Psst. What language do you think the primary implementations of C# is > written in? I know, I know, call on me! Object Pascal, obviously. -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython code giving strange errors.

2008-07-18 Thread David C. Ullrich
error when trying to run it from IDLE and I've heard that that can > happen in other Tkinter-based IDEs. So I've heard. Just for fun I tried running it in a wxPython-based shell - it worked fine. > Try running it from the command > line and I'll bet you won't get that er

Re: Weird lambda rebinding/reassignment without me doing it

2008-07-11 Thread David C. Ullrich
ds that do not explicitly contain a "return" statement return None. So when you say "return x.append(a)" you're saying "return None", which explains the rest of it. You noticed that the second line of > >>> l = mod(k,4) > >>> l didn't print anything? That's because the first line set l to None. If you'd typed "print l" instead of just "l" you would have seen >>> l = mod(k,4) >>> l >>> None -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird lambda rebinding/reassignment without me doing it

2008-07-11 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Terry Reedy <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > In article > > <[EMAIL PROTECTED]>, > > ssecorp <[EMAIL PROTECTED]> wrote: > > > >> I am never redefining the or reassigning the l

Re: Weird lambda rebinding/reassignment without me doing it

2008-07-10 Thread David C. Ullrich
): > g(l) > > > (141.0, [141.0]) > (19.0, [141.0, 19.0]) > (86.0, [141.0, 19.0, 86.0]) > (120.0, [141.0, 19.0, 86.0, 120.0]) > (76.0, [141.0, 19.0, 86.0, 120.0, 76.0]) > (262.0, [141.0, 19.0, 86.0, 120.0, 76.0, 262.0]) > (234.0, [141.0, 19.0, 86.0, 120.0, 76.0,

Re: "in"consistency?

2008-07-09 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Terry Reedy <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > In article <[EMAIL PROTECTED]>, > > Terry Reedy <[EMAIL PROTECTED]> wrote: > > >>> Is there a reason for the inconsistency? I would

Re: "in"consistency?

2008-07-08 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Terry Reedy <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > >>>> 'ab' in 'abc' > > True > > 'a' in 'abc' works according to the standard meaning of o in collecti

Re: "in"consistency?

2008-07-08 Thread David C. Ullrich
gt; returns a False. Try "[1,2] in [[1,2],[2,3]]" Thanks. I understand how it works for lists and why - I was wondering why it's not the same for strings. > David C. Ullrich wrote: > > Luckily I tried it before saying no, that's > > not how "in"

Re: "in"consistency?

2008-07-08 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Mel <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > > "David C. Ullrich" <[EMAIL PROTECTED]> writes: > > > >> >>> 'ab' in 'abc' > >> True > >> >>> [

  1   2   >