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: 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

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: 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. > > >

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]>, "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-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-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-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-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: 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: 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: 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: Homework help

2008-04-02 Thread David C. Ullrich
st)). >For example, unzip([('a', 10), ('b', 20), ('c', 30)] should evaluate >to the pair (['a', 'b', 'c'], [10, 20, 30]). > ># (2 Points) Write a python function isAscending(lst) which accepts a >non-empty list of integers and returns True if the numbers in the list >are in ascending order. Otherwise it should return False. For example, >isAscending([1]) should evaluate to True while isAscending([1,2,2]) >should return False. 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: 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: 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: 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-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-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-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-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: 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: 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: 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: 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: 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-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-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: 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: 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: 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-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 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 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-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-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-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-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 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: 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: 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: 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: >

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

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

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

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-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-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 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 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: 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: 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

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: 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.) &

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: 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: 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: 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: 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: 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

<    1   2