Re: Getting up and running with Python on a Mac

2008-05-30 Thread David C. Ullrich
nfair trial was I'd have to learn a lot about Cocoa to do anything useful. Searched a little, decided to try wxPython next, and I was very happy with that. Seems much easier - also as far as I could see there was nothing but a 'Hello World' example included in XCode, while wxPython

Re: A video introducing Ulipad, an IDE mainly for Python

2008-05-30 Thread David C. Ullrich
The documentation I got is mostly in Chinese. Is there an English version somewhere? > Dick Moores -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: re

2008-06-04 Thread David C. Ullrich
ere should (or might?) be a way to simply append a \A to the first [^a-zA-Z] and a \Z to the second. -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: re

2008-06-04 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > David C. Ullrich schrieb: > > Actually using regular expressions for the first > > time. Is there something that allows you to take the > > union of two character sets, o

Re: re

2008-06-04 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "Russell Blau" <[EMAIL PROTECTED]> wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > David C. Ullrich schrieb: > >> Say I want to replace 'disc' wit

Re: how should i use this function?

2008-06-04 Thread David C. Ullrich
ve pywinauto And, as I seem to recall someone saying once, win32ui.PyCRichEditCtrl is not a module so you can't import it. You can say from win32ui import PyCRichEditCtrl Or you can say import win32ui and then reference win32ui.PyCRichEditCtrl . -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Import removing first module component

2008-06-04 Thread David C. Ullrich
nd why the first component > "notewave" is being stripped off, when the import is happening. Does notewave contain a _module_ named runner.LMTP ? Probably not, since the error message says there's no such module. > Thanks, -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: re

2008-06-05 Thread David C. Ullrich
rd. > >Ok, then this works: Yes it does. My real question was why doesn't a construction like (A|B)C work as expected. The code below shows that it does. That puzzled me because I couldn't see any real difference between your solution here and things I'd tried that didn&#

Re: ClassName.attribute vs self.__class__.attribute

2008-06-06 Thread David C. Ullrich
l sorts of neat stuff. > > > > -Larry Bates > > -- > > http://mail.python.org/mailman/listinfo/python-list > > > > > A class instance variable, you must mean an instance attribute no? If > that is so, then with just self.attribute? Maybe there is a concept that > I don't know about, I've studied class/static attributes and instance > attributes in my OOP classes. > > Gabriel -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: how to build a street with more than 1 house ?

2008-06-07 Thread David C. Ullrich
ul__ (in a subclass?) you won't need to worry about making the same change to __rmul__. >house = type_house () >large_street = house * 25 >print large_street.front_doors >small_street = 5 * house >print small_street.front_doors David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

re quiz

2008-06-12 Thread David C. Ullrich
ut:: "a string containing '\' followed by 'n' ".) Practical question: What's a _complete_ list of the escapes included in the "and so forth" in (**)? (Or is there a function somewhere that will convert r"\remark{Hint}" to r"\\remark{Hint}

regex for balanced parentheses?

2008-06-12 Thread David C. Ullrich
hat the actual regexes in programming languages include things which are not regular expressions in that theoretical sense. David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: get keys with the same values

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 03:58:53 -0700 (PDT), Nader <[EMAIL PROTECTED]> wrote: >Hello, > >I have a dictionary and will get all keys which have the same values. > >d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f&

Re: re quiz

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 05:12:55 -0700 (PDT), John Machin <[EMAIL PROTECTED]> wrote: >On Jun 12, 8:57 pm, David C. Ullrich <[EMAIL PROTECTED]> wrote: >> True or False? (no fair looking it up) >> >> (*) If repl is a string then re.sub(pattern, repl, s) >> retur

Re: re quiz

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 14:12:31 +0200, Peter Otten <[EMAIL PROTECTED]> wrote: >David C. Ullrich wrote: > >> (Or is there a function somewhere that will convert >> r"\remark{Hint}" to r"\\remark{Hint}" for me, and >> do the same for precisely the es

Re: re quiz

2008-06-12 Thread David C. Ullrich
On 12 Jun 2008 12:32:13 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: >David C. Ullrich <[EMAIL PROTECTED]> wrote: > >> Practical question: What's a _complete_ list of the >> escapes included in the "and so forth" in (**)? >> >> (Or is

Re: regex for balanced parentheses?

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 06:38:16 -0700 (PDT), Paul McGuire <[EMAIL PROTECTED]> wrote: >On Jun 12, 6:06 am, David C. Ullrich <[EMAIL PROTECTED]> wrote: >> There's no regex that detects balanced parentheses, >> or is there? >> >> [...] > >Pyparsing i

Re: Making wxPython a standard module?

2008-06-12 Thread David C. Ullrich
quot;bad" or whatever. It has > its own bugs and missing features, of course, but it is one of the > major GUI player in the arena, together with PyQt and PyGTK. > > Andrea. > > "Imagination Is The Only Weapon In The War Against Reality." > http://xoomer.alice.it/infinity77/ -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: regex for balanced parentheses?

2008-06-12 Thread David C. Ullrich
he subject a while back - try > googling for "pyparsing tex" for further leads. > > -- Paul -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: re quiz

2008-06-12 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Johannes Bauer <[EMAIL PROTECTED]> wrote: > David C. Ullrich schrieb: > > >> -- care to tell us what "a certain re.sub" is, and > >> false in what way? > > > > Read the OP. > > Well, aren't y

Re: get keys with the same values

2008-06-12 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Nader <[EMAIL PROTECTED]> wrote: > On Jun 12, 1:41 pm, David C. Ullrich <[EMAIL PROTECTED]> wrote: > > On Thu, 12 Jun 2008 03:58:53 -0700 (PDT), Nader <[EMAIL PROTECTED]> > > wrote: > > > > >Hello, > > &

Re: get keys with the same values

2008-06-12 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jun 12, 6:41 am, David C. Ullrich <[EMAIL PROTECTED]> wrote: > > On Thu, 12 Jun 2008 03:58:53 -0700 (PDT), Nader <[EMAIL PROTECTED]> > > wrote: > > > > >Hello, &g

Re: Mapping None. Why?

2008-06-13 Thread David C. Ullrich
x27;asdf', 'qwertyuip', [0, 1, 2]) >>>> map(lambda *x: x, l1,l2,l3) == map(None, l1,l2,l3) >True >>>> > > >On looking up map on Wikipedia there is no mention of this special >behaviour, >So my question is why? > >Thanks, Paddy. David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Mapping None. Why?

2008-06-13 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Paddy <[EMAIL PROTECTED]> wrote: > On Jun 13, 12:49 pm, David C. Ullrich <[EMAIL PROTECTED]> wrote: > > On Thu, 12 Jun 2008 12:05:02 -0700 (PDT), Paddy > > > > <[EMAIL PROTECTED]> wrote: > > > > >Iam won

Re: Simple Python class questions

2008-06-20 Thread David C. Ullrich
at hard to see that it's just a pseudo code I would have _thought_ it wasn't hard to see that if a person says he's totally new to the language, and even explicitly says that the problem could be syntax errors, then he shouldn't post pseudo code. How in the world is pseudo code going to allow people to help him fix his syntax? -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: ask for a RE pattern to match TABLE in html

2008-06-26 Thread David C. Ullrich
ble > (like ) Doesn't work - for example it matches '' (and in fact if the html contains any number of tables it's going to match the string starting at the start of the first table and ending at the end of the last one.) -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: ask for a RE pattern to match TABLE in html

2008-06-27 Thread David C. Ullrich
rse nested open/close delimiters? (ii) The regexes in languages like Python and Perl include features that are not part of the formal CS notion of "regular expression". Do they include something that does allow parsing nested delimiters properly? -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: ask for a RE pattern to match TABLE in html

2008-06-30 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Dan <[EMAIL PROTECTED]> wrote: > On Jun 27, 1:32 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > > In article > > <[EMAIL PROTECTED]>, > > Jonathan Gardner <[EMAIL PROTECTED]> wrote: > > &g

Re: complex numbers should respect the "I" representation

2008-06-30 Thread David C. Ullrich
ules. Yeah, I tried Python once, found it used "j" this way and decided that Perl made a lot more sense. > This is childish. erm, yes it is, for various values of "this"... -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Do I need "self" and "other"?

2008-06-30 Thread David C. Ullrich
ugh I was confused. Otooh, I was't confused by it for long, and I quickly decided that it actually made _that_ code look like it made more sense. > Thank you! -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: ask for a RE pattern to match TABLE in html

2008-07-01 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Jun 27, 10:32 am, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > > (ii) The regexes in languages like Python and Perl include > > features that are not part of the forma

Re: caseless dict - questions

2008-07-07 Thread David C. Ullrich
ance gives the actual dictionary instead of its internal > representation. > Constructing a dictionary and returning from __init__ method did not > work. It's not entirely clear to me what you want: Since this is supposed to be a "caseless" dict, I imagine that if you say d['Name'] = 'first value' d['name'] = 'new value' then d['Name'] should now be 'new value'. Fine. Now in that case exactly what do you want to see when you print d? Do you want to see {'name':'new value'} or {'name':'new value', 'Name': 'newvalue'}? > TIA, > Senthil -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: How to make a function associated with a class?

2008-07-07 Thread David C. Ullrich
gt; > HTH > > As far as I understood, In the first case, you gave, I need to call > the function as follows "x.dot(y)". In the second case I need to call > the function as follows "x*y". But I want to call the function as > follows "dot(x,y)". You want to say dot(x,y), but to have the actual behavior determined by the class of which x and y are instances? You could do this: def dot(x,y): return x.dot(y) and now give Vector an appropriate dot(self, other) method. > By the way, "type(self)" returns the name of the class to which the > "self" belongs? > Does "instance" return "true" if the first argument belongs to the > class whose name is given in the second argument? -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

"in"consistency?

2008-07-07 Thread David C. Ullrich
Luckily I tried it before saying no, that's not how "in" works: >>> 'ab' in 'abc' True >>> [1,2] in [1,2,3] False Is there a reason for the inconsistency? I would have thought "in" would check for elements of a sequence, regardless o

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

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]>, 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-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: 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: 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-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: 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: Python Written in C?

2008-07-21 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Erik Max Francis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > I'm just learning about Python now and it sounds interesting. But I > > just read (on the Wiki page) that mainstream Python was written in C. > >

Re: Parsing VHDL with python, where to start.

2008-07-23 Thread c d saunter
Svenn Are Bjerkem ([EMAIL PROTECTED]) wrote: : Hi, : I am in the need to write an application for PyQt to visualise the : structure of a VHDL project I am working on. Looking for a sensible : way to parse VHDL files and putting them into a data structure that : PyQt can represent as a tree (or what

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

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]>, Peter Otten <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > In article <[EMAIL PROTECTED]>, > > Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > >> David C. Ullrich wrote: > >> > >

Re: PyOpenGL Tutorial?

2008-07-25 Thread Mike C. Fletcher
x27;s also tutorials that are not wxPython specific on the PyOpenGL documentation page. HTH, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

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: multiple inheritance and __getattr__

2008-07-28 Thread David C. Ullrich
aise AttributeError('%s not found in B' % name) > > Both classes have a __getattr__ method. > Now I want to have a class that inherits from both so I write: > > >>> class C(B,A): > pass > > The problem arise when I try something like this: > >>

Re: multiple inheritance and __getattr__

2008-07-29 Thread David C. Ullrich
t; print 'B.__getattr__' > > if name == 'b': return 1 > > raise AttributeError('%s not found in B' % name) > > > > Both classes have a __getattr__ method. > > Now I want to have a class that inherits from both so I write: > > &

PIL (etc etc etc) on OS X

2008-08-01 Thread David C. Ullrich
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, nothing about installing libraries, nothing about "fink", nothing about anything. Please insert question marks after every sentence: I saw a &quo

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

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: 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-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-04 Thread David C. Ullrich
c$ sudo make install Password: /usr/bin/install -c cjpeg /usr/local/bin/cjpeg /usr/bin/install -c djpeg /usr/local/bin/djpeg /usr/bin/install -c jpegtran /usr/local/bin/jpegtran /usr/bin/install -c rdjpgcom /usr/local/bin/rdjpgcom /usr/bin/install -c wrjpgcom /usr/local/bin/wrjpgcom /usr/bin/install

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-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]>, "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
en you > would be able to access the class's objects with foo.objectname. Using > self is simply the recommended standard. Close, but not quite. "self" is not really the name of the object, it's just the name of the first parameter. You can change the name of that pa

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
A component of a pair can be obtained using an index in brackets as >with lists (and strings!). For example: > >>>> (33,44)[0] >33 > >Write a function zip(lst1, lst2) such that zip accepts two equal >length lists and returns a list of pairs. For example, zip(['a&

Re: Importing My Own Script

2008-04-17 Thread Raúl Gómez C.
Victor, you can do this in order to load your own modules: import sys,os sys.path.append(os.getcwd()) import your_module On Fri, Apr 18, 2008 at 12:34 PM, Ben Kaplan <[EMAIL PROTECTED]> wrote: > It might be something in mod python. Try asking on their mailing list. > > - Original Message

Re: calling variable function name ?

2008-05-06 Thread Blais, Gerard C.
Sure! Make a dictionary: fdict = {"A":fa, "B":fb, ... } Then consider x = "A" result = fdict(x)(param1, param2) should call fa without any if's... Gerry -- http://mail.pytho

Re: The Importance of Terminology's Quality

2008-05-07 Thread Bruce C. Baker
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [...] (for example, Perl's naming heavily relies on unix culture (grep, pipe, hash...), ... "hash" + "pipe"? Ah, /no wonder/ Perl is the syntactic mishmash it is! ;-) -- 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
s called with args = %s, kwargs = %s" % (self.func.__name__, str(args), str(kwargs)) self.func(*args, **kwargs) @Logger def FoodList(a, b, c="spam"): text = "Food is %s, %s, %s" % (a, b, c) print text return text if __name__ ==

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: Some questions about PyOpenGL and wxPython

2008-09-21 Thread Mike C. Fletcher
e doing to know what's wrong there. glColor should be working. HTH, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PyOpenGL double-buffered hardware surface

2008-10-05 Thread Mike C. Fletcher
lay module. If wxPython, see their GLcanvas object. If GLUT, see glutInitDisplayMode, etceteras. Good luck, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.o

Re: Speed of data structures in python

2006-03-10 Thread Mike C. Fletcher
hes you can take: * array-based geometry -- this relies on fast memory-transfer rates operating a C speeds * display-list-based geometry -- this relies on moving all of the data over to the card If you can reduce your entire (static) scene to a single display-list call, you&

Re: Cheese Shop: some history for the new-comers

2006-03-11 Thread Mike C. Fletcher
unication appropriately. When/if the user "gets" that the Package Index is the Cheese Shop they can feel great having pierced that bubble, but don't force them to pierce it to get the software they need. Just my two cents, Mike -- Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

TKinter problem

2006-03-21 Thread C D Wood
To whom this may concern, Below is the source code, which demonstrates a problem I am having making a GUI for my python project work. 'table.txt' is a file that is read from the same folder. My code writes to a text file 'table.txt', and 'table.txt' is dis

Re: Can I control Video Card by using Python under linux?

2006-03-31 Thread Mike C. Fletcher
LUK wrote: > Hi, I have a video card based on cx2388 chip to catch video and do the > other thing. > There's already a V4L2 driver for it, but it is too hard for me to > program in C. > Can I use Python do the job? > Does Python has simpler APIs? > Please gvie me

Re: Library support for Python 3.x

2010-01-27 Thread Mike C. Fletcher
re) speedup (PyPy, Unladen Swallow) * adaptive parallelization/execution-kernel mechanism as a first-class primitive (Apple's C extensions for OpenCL) * continuation-like mechanisms, anonymous code blocks a-la Ruby (PyPy, Stackless) * (free) threading, GIL removal (

Re: PyOpenGL and graphics card support

2009-10-01 Thread Mike C. Fletcher
nt name,glGetString(name) HTH, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

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
t;The second call, however, doesn't even try to >allocate the memory, but decides that the range can't >be represented. That's not right: this is an LP64 >machine, so the size of the list can be represented, >and the start, stop and step values are representable &g

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 = '001

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

<    5   6   7   8   9   10   11   12   >