(MAC) CoreGraphics module???

2007-11-01 Thread David C. Ullrich
here a working CoreGraphics.py around somewhere? I found a file somewhere on the net that was the same as mine except it ended with from CG import * Adding that doesn't change anything.) (Yes, the XCode installation seems to be working fine.) ??? **** David C. Ullrich

Re: (MAC) CoreGraphics module???

2007-11-02 Thread David C. Ullrich
On Thu, 01 Nov 2007 19:39:20 -0500, Robert Kern <[EMAIL PROTECTED]> wrote: >David C. Ullrich wrote: >> [why doesn't CoreGraphics work?] > >That's different than the one that is referenced. The one those articles >reference is only available in the Python tha

Re: (MAC) CoreGraphics module???

2007-11-03 Thread David C. Ullrich
On Fri, 02 Nov 2007 14:09:25 -0500, Robert Kern <[EMAIL PROTECTED]> wrote: >David C. Ullrich wrote: >> [...] >> >> So CoreGraphics is a builtin in Apple-Python, >> explaining why I didn't find the relevant >> CoreGraphics.py anywhere on the hard driv

Re: (MAC) CoreGraphics module???

2007-11-03 Thread David C. Ullrich
On Fri, 2 Nov 2007 13:14:16 +0100, Tommy Nordgren <[EMAIL PROTECTED]> wrote: > >On 2 nov 2007, at 02.10, David C. Ullrich wrote: > >> [Why doesn't CoreGraphics work?] >> -- >> http://mail.python.org/mailman/listinfo/python-list > There are Python

Re: (MAC) CoreGraphics module???

2007-11-04 Thread David C. Ullrich
On Fri, 02 Nov 2007 14:09:25 -0500, Robert Kern <[EMAIL PROTECTED]> wrote: >David C. Ullrich wrote: >> [???] > >Okay, which version of OS X do you have? In 10.3 and 10.4 it used to be here: >/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-

Re: (MAC) CoreGraphics module???

2007-11-05 Thread David C. Ullrich
On Sun, 04 Nov 2007 15:56:21 -0600, Robert Kern <[EMAIL PROTECTED]> wrote: >David C. Ullrich wrote: >> On Fri, 02 Nov 2007 14:09:25 -0500, Robert Kern >> <[EMAIL PROTECTED]> wrote: >> >>> David C. Ullrich wrote: >>>> [???] >>> Okay,

Speaking Text

2008-03-19 Thread David C. Ullrich
Linux presumably it only works if there happens to be a speech engine available...) David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Speaking Text

2008-03-20 Thread David C. Ullrich
On Wed, 19 Mar 2008 07:41:29 -0500, David C. Ullrich <[EMAIL PROTECTED]> wrote: >Mac OS X has text-to-speech built into the interface. >So there must be a way to access that from the command >line as well - in fact the first thing I tried worked: > >os.system('say hell

Re: Problem with complex numbers

2008-03-23 Thread David C. Ullrich
then you get exactly one z**w. But that's not always the z**w that you need for your problem... >Ask >Google for some examples Thanks. >Christian 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: 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: 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: 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-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: 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: 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: 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: 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-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-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

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

Re: wxpython dialog - do something after ShowModal()?

2008-05-14 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Iain King <[EMAIL PROTECTED]> wrote: > Hi. I have a modal dialog whcih has a "Browse..." button which pops > up a file selector. This all works fine, but the first thing the user > has to do when they open the dialog is select a file, so I would like > the dialo

sys.excepthack...

2008-05-14 Thread David C. Ullrich
self.buffer = '' def write(self, text): self.buffer = self.buffer + text def Show(self): wx.MessageDialog(None, str(self.buffer), 'Error:',wx.OK).ShowModal() self.buffer = '' printer = ErrorDisplay() sys.stderr = prin

"indexed properties"...

2008-05-14 Thread David C. Ullrich
AClass() for row in range(2): for col in range(2): C.cell[row, col] = "row: %s, col: %s" % (row, col) for row in range(2): for col in range(2): print C.cell[row, col] C.cell[0,0], C.cell[1,1] = C.cell[1,1], C.cell[0,0] print "After C.cell[0,0], C.cell[1,1] = C.cell[1,1], C.cell[0,0]:" for row in range(2): for col in range(2): print C.cell[row, col] -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.excepthack...

2008-05-14 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Wed, 14 May 2008 15:47:18 -0500, "David C. Ullrich" <[EMAIL PROTECTED]> > wrote: > > [snip] > > > >Came up with a ridiculous hack involving both sys.stderr

Re: "indexed properties"...

2008-05-16 Thread David C. Ullrich
On Thu, 15 May 2008 10:59:41 -0300, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >En Wed, 14 May 2008 18:15:41 -0300, David C. Ullrich <[EMAIL PROTECTED]> >escribió: > >> Having a hard time phrasing this in the form >> of a question... >> &g

Re: "indexed properties"...

2008-05-17 Thread David C. Ullrich
On Sat, 17 May 2008 00:27:31 -0300, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >(warning: it's a rather long message) > >En Fri, 16 May 2008 12:58:46 -0300, David C. Ullrich ><[EMAIL PROTECTED]> escribió: >> On Thu, 15 May 2008 10:59:41 -0

Re: "indexed properties"...

2008-05-18 Thread David C. Ullrich
;t see the plus side. Hmm. It might actually _reduce_ the total amount of code, since the code to access columns has to exist anyway and rows could use the same code as columns with different "start" and "skip". And come to think of it rows and columns could be obtained just with a slice of the data. So column access might even be more efficient. But I expect that row access will happen a lot more often than column access. >P. David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python for programming algorithms

2008-05-18 Thread David C. Ullrich
it is seen as "just funny" in a research >context. Is Python considered as a good programming language for >implementing Operations Research algorithms, such as heuristics and >other soft-computing algorithms? > >Maybe this is not the right forum, but maybe you can give me some >hints or tips... > >Thank you in advance. David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: "indexed properties"...

2008-05-19 Thread David C. Ullrich
m.) Really. In one of the intended applications the matrix entries are going to be home-made Rationals. Just adding two of those guys takes a long time. It's still more than fast enough for the intended application, but [oh, never mind. Sorry about the argumentative tone - I _would_ like to know which "untenable position" you're referring to... >P. David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: python script to windows exe

2008-05-19 Thread David C. Ullrich
y(mailItem): > >name="\\"+mailItem.Subject+"__"+str(mailItem.ReceivedTime) >print name >#global outlook_app >try: >mailItem.SaveAs(path+name+".txt",OlSaveAsType['olTXT']) >except BaseException: >prin

Re: How do *you* use Python in non-GUI work?

2008-05-20 Thread David C. Ullrich
arious programs available that would solve his problem for him - writing a little Python to give the solution took less time than downloading one of those programs would have. >Thanks. David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: "indexed properties"...

2008-05-20 Thread David C. Ullrich
On Mon, 19 May 2008 14:48:03 +0200, pataphor <[EMAIL PROTECTED]> wrote: >On Mon, 19 May 2008 06:29:18 -0500 >David C. Ullrich <[EMAIL PROTECTED]> wrote: > >> Maybe you could be more specific? Various "positions" I've >> taken in all this may wel

Re: "indexed properties"...

2008-05-20 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, pataphor <[EMAIL PROTECTED]> wrote: > On Tue, 20 May 2008 06:12:01 -0500 > David C. Ullrich <[EMAIL PROTECTED]> wrote: > > > Well, ok. Like I said, I never _took_ the position that it _should_ > > be a list of lists, I

Re: "indexed properties"...

2008-05-22 Thread David C. Ullrich
On Wed, 21 May 2008 12:47:44 +0200, pataphor <[EMAIL PROTECTED]> wrote: >On Tue, 20 May 2008 10:40:17 -0500 >"David C. Ullrich" <[EMAIL PROTECTED]> wrote: > >> > > Today's little joke: Long ago I would have solved >> > > this by st

Re: Relationship between GUI and logic?

2008-05-23 Thread David C. Ullrich
ainly an issue of terminology, so probably I should just read up on MVC. > >> The user interface doesn't need to be graphical. There were games and >> emails clients and text editors before GUIs existed, you know ? > >Of course, but I'm specifically asking about creating a program that has a >GUI, and even more specifically it would be wxPython. > David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow

2008-05-24 Thread David C. Ullrich
te-code. >> >> Which is then interpreted, but you're still technically right, because >> "compiled" can mean either compiled to bytecode or compiled to native code, >> despite what it actually did mean. Semantics FTW!! > >Yes, semantics. But a bit more than semantics - byte-code interpreters >are usually way faster than "pure" interpreter, and start to be fast >enough for quite a lot of practical use. > >Ok, I'll stop on this - once again, sorry for the noise, and please >bear with me, I tend to be a bit too much on the pedantic side >sometimes. But still, thanks to the pedantics peoples on usenet that >taught me so much so far and still teach me more and more... David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Relationship between GUI and logic?

2008-05-24 Thread David C. Ullrich
final configuration betore saying anything to the model. The model should only deal with legal positions. (Could be that it's not until we start actually playing the game through the GUI that we find the model can't deal with two black queens. But that's not an example either, that would just mean the model is wrong, not allowing every legal position.) >-M- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: WXpython Question

2008-05-24 Thread David C. Ullrich
; >> Have fun! And remember, there's a great wxPython mailing list too: >> >> http://www.wxpython.org/maillist.php >> >> Mike > >Thanks! You should also note docs.wxwidgets.org (I tend to find that by googling "wxTreeCtrl" or whatever.) The descriptions of various components there are more complete than in the (excellent!) wxPython book - it's C++ but usually not hard to figure out what the corresponding wxPython should be. David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: access interactive namespace from module (shared namespace?)

2008-05-25 Thread David C. Ullrich
;""utest.py""" import __main__ def doit(): print 2*__main__.a >Cheers, > >Ulrich > > David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: How to covert ASCII to integer in Python?

2008-05-30 Thread David C. Ullrich
7;s actually a problem you're trying to solve here, try ord instead of int. > Or probably you yourself should - quote : > "You probably should go through the tutorial ASAP that is located here: > > http://docs.python.org/tut/ " > > - > [Image] -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting up and running with Python on a Mac

2008-05-30 Thread David C. Ullrich
st relevant - I'd > appreciate your guidance on getting Python to run on a Mac with a > particular focus on these two distributions. > > Thank you in advance > > Thomas Philips -- David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

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
rch(r"(^|[^\w])(disc)($|[^\w])", t): > print "success:", t > > >> Also I think you have ^ and $ backwards, and there's >> a ^ I don't understand. I _think_ that a correct version > >Yep, sorry for the confusion. > >Diez David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list

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
key) except KeyError: dd[value] = [key] Possibly dd is now what you really want; if you really want what you said you want you could use [l for l in dd.values() if len(l) > 1] >I will something as : > >d.keys(where their values are the same) > >With this statement I c

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

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

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

  1   2   >