xlutils 1.0.0 released!

2008-11-09 Thread Chris Withers
Hi All, I'm pleased to announce the first release of xlutils. This is a small collection of utilities that make use of both xlrd and xlwt to process Microsoft Excel files. The current utilities included are: xlutils.margins Tools for finding how much of an Excel file contains useful data.

Re: parsing non-ascii characters

2008-11-09 Thread 一首诗
On Nov 10, 10:13 am, Ronn <[EMAIL PROTECTED]> wrote: > Hello all, > > I have a list: >   suffix = ["aĉ", "ad", "aĵ", "an", "ar"] > > and I'm trying to check a word to see if any of the suffixes exist in > the list for example: >   if word in suffix: >       print "A suffix exist in your word" > > w

Re: pysqlite install error on hp ux (ld: Can't find library for -lpython2.5)

2008-11-09 Thread 一首诗
On Nov 10, 10:29 am, "Geon." <[EMAIL PROTECTED]> wrote: > hi everyone! > > when i install pysqlite i meet bellow error. ( use easy_install and > source code building same problem ) > > ld: Can't find library for -lpython2.5 > > what mean this message? and what i do? > > my system is hp-ux 11i v3. a

Re: My first Python program -- a lexer

2008-11-09 Thread Paul McGuire
On Nov 9, 8:34 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 09 Nov 2008 23:33:30 +0100, Thomas Mlynarczyk > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > > > Of course. For the actual message I would use at least the line number. > > Still, the offset could

Re: sorting list of complex numbers

2008-11-09 Thread skip
>> Timeit suggests the single sort returning the real, imag tuples is >> faster than two sorts each on one field, as you might expect since >> many fewer calls to the key function are made. Steve> Only half the number, of course. The advantage of the key Steve> function is tha

Re: parsing non-ascii characters

2008-11-09 Thread John Machin
On Nov 10, 1:13 pm, Ronn <[EMAIL PROTECTED]> wrote: > Hello all, > > I have a list: >   suffix = ["aĉ", "ad", "aĵ", "an", "ar"] > > and I'm trying to check a word to see if any of the suffixes exist in > the list for example: >   if word in suffix: >       print "A suffix exist in your word" > > wh

Re: pysqlite install error on hp ux (ld: Can't find library for -lpython2.5)

2008-11-09 Thread Geon.
On 11월10일, 오전11시29분, "Geon." <[EMAIL PROTECTED]> wrote: > hi everyone! > > when i install pysqlite i meet bellow error. ( use easy_install and > source code building same problem ) > > ld: Can't find library for -lpython2.5 > > what mean this message? and what i do? > > my system is hp-ux 11i v3. a

Re: pysqlite install error on hp ux (ld: Can't find library for -lpython2.5)

2008-11-09 Thread Jeremiah Dodds
On Sun, Nov 9, 2008 at 9:29 PM, Geon. <[EMAIL PROTECTED]> wrote: > hi everyone! > > when i install pysqlite i meet bellow error. ( use easy_install and > source code building same problem ) > > ld: Can't find library for -lpython2.5 > > what mean this message? and what i do? > > my system is hp-ux

Re: Installing Python 2.6 on Vista

2008-11-09 Thread Steve Holden
Fuzzyman wrote: > On Nov 9, 7:39 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >>> Heh. Well it would, except the administrator user doesn't have a >>> password (purely a VM) and this is unacceptable for runas. :-) >> There is, unfortunately, no other way to install Python 2.6 on Vista. >> So yo

pysqlite install error on hp ux (ld: Can't find library for -lpython2.5)

2008-11-09 Thread Geon.
hi everyone! when i install pysqlite i meet bellow error. ( use easy_install and source code building same problem ) ld: Can't find library for -lpython2.5 what mean this message? and what i do? my system is hp-ux 11i v3. and python2.5 is installed. ld command also avaliable. please help for m

Re: sorting list of complex numbers

2008-11-09 Thread Steve Holden
[EMAIL PROTECTED] wrote: [...] > Duncan> If you don't like the tuple then just do the two sorts separately: > > lst.sort(key=lambda x: x.imag) > lst.sort(key=lambda x: x.real) > ... > > I tried that. I could have sworn when I read through the output it hadn't > retained

parsing non-ascii characters

2008-11-09 Thread Ronn
Hello all, I have a list: suffix = ["aĉ", "ad", "aĵ", "an", "ar"] and I'm trying to check a word to see if any of the suffixes exist in the list for example: if word in suffix: print "A suffix exist in your word" when I run this it give me an error: SyntaxError: Non-ASCII character

Re: creating a block file for file-like object

2008-11-09 Thread Iain
On Nov 8, 10:00 am, Iain <[EMAIL PROTECTED]> wrote: > On Nov 7, 4:42 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] > > central.gen.new_zealand> wrote: > > In message > > <[EMAIL PROTECTED]>, Iain > > wrote: > > > > Can someone give me some pointers as to how I might create some sort > > > of blocking

Re: Where to locate existing standard encodings in python

2008-11-09 Thread Mark Tolonen
"News123" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I was googling quite some time before finding the answer to my question: 'what are the names for the encodings supported by python?' I found the answer at http://python.active-venture.com/lib/node127.html Now my quest

Re: Python 3.0 - is this true?

2008-11-09 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > The "homogeneous vs. heterogeneous" discussion is not that much about > type, but more about semantics of the individual values. If you > represent (firstname, lastname, age), you use tuples - three different > (and or

Re: Where to locate existing standard encodings in python

2008-11-09 Thread Philip Semanchuk
On Nov 9, 2008, at 7:00 PM, News123 wrote: Hi, I was googling quite some time before finding the answer to my question: 'what are the names for the encodings supported by python?' I found the answer at http://python.active-venture.com/lib/ node127.html Now my question: Can I find the

Re: Where to locate existing standard encodings in python

2008-11-09 Thread John Machin
On Nov 10, 11:00 am, News123 <[EMAIL PROTECTED]> wrote: > Hi, > > I was googling quite some time before finding the answer to my question: > 'what are the names for the encodings supported by python?' > > I found the answer athttp://python.active-venture.com/lib/node127.html > > Now my question: >

Re: Where to locate existing standard encodings in python

2008-11-09 Thread Tim Chase
I was googling quite some time before finding the answer to my question: 'what are the names for the encodings supported by python?' I found the answer at http://python.active-venture.com/lib/node127.html Now my question: Can I find the same info in the standard python doc or query python with

Re: Spawning a new UI process

2008-11-09 Thread Ed Leafe
On Nov 9, 2008, at 4:42 PM, Steve Holden wrote: Ed! Good to see you on c.l.py! I usually only get around to reading the list when I'm having a problem I can't figure out. . Simply too busy most of the time. a) Try using the subprocess module b) Use *.pyw programs to ensure no c

Where to locate existing standard encodings in python

2008-11-09 Thread News123
Hi, I was googling quite some time before finding the answer to my question: 'what are the names for the encodings supported by python?' I found the answer at http://python.active-venture.com/lib/node127.html Now my question: Can I find the same info in the standard python doc or query python

Re: My first Python program -- a lexer

2008-11-09 Thread John Machin
On Nov 10, 9:33 am, Thomas Mlynarczyk <[EMAIL PROTECTED]> wrote: > John Machin schrieb: > > >>> dict.iter() will return its results in essentially random > >>> order. > > A list of somethings does seem indicated. > > On the other hand: If all my tokens are "mutually exclusive" then, But they won't

Re: why does this call to re.findall() loop forever?

2008-11-09 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Hi everyone, I am using Python's re module to extract some data from html. The following code never returns, and I was wondering if someone can explain to me why. Is this a problem with my regexp (I tried really hard to find it?)? [snip] html/xml string regexp = re.com

Re: Workflow engine?

2008-11-09 Thread Grzegorz Staniak
On 09.11.2008, Tino Wildenhain <[EMAIL PROTECTED]> wroted: >>> I think that was part of the problem.. you asked if the wheel had >>> already been invented, rather than tell us about the stones you have >>> to haul up a mountain, and whether a wheel is what you need. It's >>> difficult to answer y

Re: why does this call to re.findall() loop forever?

2008-11-09 Thread james . kirin40
My apologies, given that Google Groups messes up the formatting, the regexp should read regexp = re.compile("""(.*?).*?\s*(?:(.*?))?.*?(?:to ((?: ) +))*.*?.*?\s*.*?""", re.DOTALL) -- http://mail.python.org/mailman/listinfo/python-list

why does this call to re.findall() loop forever?

2008-11-09 Thread james . kirin40
Hi everyone, I am using Python's re module to extract some data from html. The following code never returns, and I was wondering if someone can explain to me why. Is this a problem with my regexp (I tried really hard to find it?)? The string contains three records (list items in a html page). Not

Re: Workflow engine?

2008-11-09 Thread Grzegorz Staniak
On 08.11.2008, Piotr Chamera <[EMAIL PROTECTED]> wroted: >> In a couple of weeks I'm starting a medium-size project (using a web >> framework) involving a workflow implementation. Are you aware of any >> open source workflow engines/libraries that I could base the project >> on? Google returns

Re: Python 3.0 - is this true?

2008-11-09 Thread Martin v. Löwis
> Hmmm, I seem to have engaged in a bit of topic drift, for which I > apologize. I was commenting specifically on the issue of lists holding > heterogeneous types, not on heterogeneous types being sortable. Still, I don't think this is a valid counter-example: I claim that the data in the list

Re: Spawning a new UI process

2008-11-09 Thread Steve Holden
Ed Leafe wrote: > I'm working on a wxPython app (well, a Dabo app, but it's basically > the same thing) that presents the user with a selection of several > wxPython apps that exist on their system. They choose one, and I want to > then "launch" that app, as if they had typed "python myapp.py"

Re: My first Python program -- a lexer

2008-11-09 Thread Thomas Mlynarczyk
John Machin schrieb: [...] You have TWO problems: (1) Reporting the error location as (offset from the start of the file) instead of (line number, column position) would get you an express induction into the User Interface Hall of Shame. Of course. For the actual message I would use at least

Re: SocketServer.ThreadingTCPServer accepts clients outside server_forever

2008-11-09 Thread Mark Tolonen
"Okko Willeboordse" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello, SocketServer.ThreadingTCPServer accepts connections (clients can connect) before and after it's server_forever method is called, see below for an example. IMHO it should only accept connections while server

Re: is there really no good gui builder

2008-11-09 Thread Phil Thompson
On 9 Nov 2008 19:08:35 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > Phil Thompson wrote: > >>> Thay aren't claiming that Qt itself is governed by the GPL, what they >>> are claiming is that the 'Qt Open Source License' permits you to use it >>> for development of "Open Source software governed b

Re: Python 3.0 - is this true?

2008-11-09 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > One added value in Python 3.0 would be that they are sortable in a > `list`. But seriously, your token example should work fine with > Python 3.0 because the wish to sort tokens is a bit exotic IMHO. Hmmm,

Re: why am I not allowed to redefine a class ?

2008-11-09 Thread Stef Mientki
thanks guys. cheers, Stef Terry Reedy wrote: Stef Mientki wrote: hello, although this is not a real problem for me, it was caused by a copying, instead of moving, a piece of code. But I don't understand at all why the code below gives the error. class derived_class, is defined twice, the erro

Mlk day of service - Free

2008-11-09 Thread adjointmcelroydp
Mlk day of service . . . ***CLICK HERE http://vids247.cn/Mlk-day-of-service- * . . . . . . . . . . . . Mlk day of service -- http://mail.python.org/mailman/listinfo/python-list

Christina sturmer - Free

2008-11-09 Thread adjointmcelroydp
Christina sturmer . . . ***CLICK HERE http://vids247.cn/Christina-sturmer * . . . . . . . . . . . . Christina sturmer -- http://mail.python.org/mailman/listinfo/python-list

Talambuhay ninoy aquino - Free

2008-11-09 Thread adjointmcelroydp
Talambuhay ninoy aquino . . . ***CLICK HERE http://vids247.cn/Talambuhay-ninoy-aquino- * . . . . . . . . . . . . Talambuhay ninoy aquino -- http://mail.python.org/mailman/listinfo/python-list

Cramer meltdown - Free

2008-11-09 Thread adjointmcelroydp
Cramer meltdown . . . ***CLICK HERE http://vids247.cn/Cramer-meltdown * . . . . . . . . . . . . Cramer meltdown -- http://mail.python.org/mailman/listinfo/python-list

Bigtitsatschool - Free

2008-11-09 Thread adjointmcelroydp
Bigtitsatschool . . . ***CLICK HERE http://vids247.cn/Bigtitsatschool * . . . . . . . . . . . . Bigtitsatschool -- http://mail.python.org/mailman/listinfo/python-list

Re: Dispatch('Excel.Application') on Vista from Task Scheduler

2008-11-09 Thread Larry Bates
Cupric wrote: I have a python script that runs fine from the command line or from within IDLE, but doesn't work through the Vista Task Scheduler. The script downloads some csv files and then uses pywin32 to combine the csv files into a single document. When I run it through the task scheduler, i

Re: Is psyco available for python 2.6?

2008-11-09 Thread Kay Schluehr
On 9 Nov., 20:44, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Nov 9, 2:18 pm, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > > > > > On Thu, 30 Oct 2008 17:45:40 +0100 > > > Gerhard Häring <[EMAIL PROTECTED]> wrote: > > > psyco seems to just work on Linux with Python 2.6. So it is probably > > > "only"

Re: Python COM: Automatic wrap/unwrap?

2008-11-09 Thread Larry Bates
Greg Ewing wrote: I'm creating a COM server in Python that will have one main class, with methods that create and return instances of other classes. I've found that I need to use win32com.server.util.wrap and unwrap on these objects when they pass over a COM connection. This doesn't seem very co

Re: Does Python have Multiple Inheritance ?

2008-11-09 Thread Larry Bates
Lawrence D'Oliveiro wrote: In message <[EMAIL PROTECTED]>, Steve Holden wrote: Lawrence D'Oliveiro wrote: In message <[EMAIL PROTECTED]>, Michele Simionato wrote: On Nov 7, 4:38 pm, Tim Golden <[EMAIL PROTECTED]> wrote: Seriously, though, although Python does indeed support multiple inher

Re: Looking for a nitty-gritty Python Ajax middleware script to fire off a number of processors

2008-11-09 Thread Larry Bates
Shao wrote: Dear All, I am looking for a nitty-gritty Python Ajax script to fire off a number of processing programmes, periodically checking their operations, sending messages back to an HTML div form by sending back the links of generated data files, to be downloaded by end users. I am using .

Re: is there really no good gui builder

2008-11-09 Thread David Boddie
On Sunday 09 November 2008 20:08, Duncan Booth wrote: > So are the references to 'Qt Open Source License' on the website > misleading? It depends on whether you assume that there's a separate license by that name. In practice, it's a placeholder for the licenses it's available under: "The Open S

Re: Python 3.0 - is this true?

2008-11-09 Thread Kay Schluehr
On 9 Nov., 17:49, Terry Reedy <[EMAIL PROTECTED]> wrote: > I was asking the OP ;-) Thank you for the discussion. -- http://mail.python.org/mailman/listinfo/python-list

module cwiid and threading: how to use cwiid.Wiimote without blocking

2008-11-09 Thread News123
Hi, I'm using the module cwiid to conncet to a wiimote. import cwiid wiimote = cwiid.Wiimote() This function is blocking: It waits until it could sucessfully connect to a device or until 20 seconds passed without sucessful connection. As I wanted to do some things even if the wii-mote is not co

Logging thread with Queue and multiple threads to log messages

2008-11-09 Thread [EMAIL PROTECTED]
I am trying to put up a queue (through a logging thread) so that all worker threads can ask it to log messages. However, the problem I am facing is that, well, the logging thread itself is running forever. It does not know when it should exit. Any suggestion? None of the worker threads knows for

SocketServer.ThreadingTCPServer accepts clients outside server_forever

2008-11-09 Thread Okko Willeboordse
Hello, SocketServer.ThreadingTCPServer accepts connections (clients can connect) before and after it's server_forever method is called, see below for an example. IMHO it should only accept connections while server_forever is running. Kind regards, Okko Example, both _socket.connect calls shoul

Re: Is psyco available for python 2.6?

2008-11-09 Thread bearophileHUGS
Fuzzyman: > I've built a Windows installer if anyone is interested: Thank you to both. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: is there really no good gui builder

2008-11-09 Thread azrael
It would be rally great if wingIDE would have integrated controls for wxPython.This would be really great. -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 2.6 on Vista

2008-11-09 Thread Martin v. Löwis
> It installs fine for 'just me', so no problem. It installs for 'just me', but it doesn't work. Just try starting IDLE, or import the socket module. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

module dcop.: How to query running apps?

2008-11-09 Thread News123
Hi, I wrote a small application connecting to an application and sending commands to it. Currently I'm using the methods import dcop client = dcop.DCOPClient() client.registerAs(appname) ama = dcopclient.rc = dcop.DCOPRef("amarok", "player") controlling the app works now fine with for example

Re: Is psyco available for python 2.6?

2008-11-09 Thread Fuzzyman
On Nov 9, 2:18 pm, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > On Thu, 30 Oct 2008 17:45:40 +0100 > > Gerhard Häring <[EMAIL PROTECTED]> wrote: > > psyco seems to just work on Linux with Python 2.6. So it is probably > > "only" a matter of compiling it on Windows for Python 2.6. > > Yes. I compile

Re: Installing Python 2.6 on Vista

2008-11-09 Thread Fuzzyman
On Nov 9, 7:39 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Heh. Well it would, except the administrator user doesn't have a > > password (purely a VM) and this is unacceptable for runas. :-) > > There is, unfortunately, no other way to install Python 2.6 on Vista. > So your choices are rea

Re: My first Python program -- a lexer

2008-11-09 Thread John Machin
On Nov 10, 1:39 am, Thomas Mlynarczyk <[EMAIL PROTECTED]> wrote: > John Machin schrieb: > > > Be consistent with your punctuation style. I'd suggest *not* having a > > space after ( and before ), as in the previous line. Read > >http://www.python.org/dev/peps/pep-0008/ > > What were the reasons for

Re: Python 3.0 - is this true?

2008-11-09 Thread Arnaud Delobelle
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: >> Even in 2.x it doesn't work (I think I posted this earlier but I'm not >> sure anymore) as this example shows: >> >> 2 < 3j and 3j < True, but True < 2 > > What specific value of x have you been trying? For x=4,5,6, I get > > py> 2 < 3j and 3j

Re: Installing Python 2.6 on Vista

2008-11-09 Thread Martin v. Löwis
> Heh. Well it would, except the administrator user doesn't have a > password (purely a VM) and this is unacceptable for runas. :-) There is, unfortunately, no other way to install Python 2.6 on Vista. So your choices are really: 1. activate the Administrator account 2. disable UAC 3. go back to X

Re: Python 3.0 - is this true?

2008-11-09 Thread Martin v. Löwis
> Even in 2.x it doesn't work (I think I posted this earlier but I'm not > sure anymore) as this example shows: > > 2 < 3j and 3j < True, but True < 2 What specific value of x have you been trying? For x=4,5,6, I get py> 2 < 3j and 3j < True Traceback (most recent call last): File "", line

Re: is there really no good gui builder

2008-11-09 Thread Duncan Booth
Phil Thompson wrote: >> Thay aren't claiming that Qt itself is governed by the GPL, what they >> are claiming is that the 'Qt Open Source License' permits you to use it >> for development of "Open Source software governed by the GNU General >> Public License versions 2 and 3". I believe they can m

Re: Python 3.0 - is this true?

2008-11-09 Thread Arnaud Delobelle
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: >> def comp(x1, x2): >>try: >>if x1>return -1 >>else: >>return 1 >>except TypeError: >>if str(x1)>return -1 >>else: >>return 1 >> > > Please correct me if I'm wron

Re: Python 3.0 - is this true?

2008-11-09 Thread Martin v. Löwis
Hallvard B Furuseth wrote: > Terry Reedy writes: >> If you want to duplicate 2.x behavior, which does *not* work for all >> types... >> >> def py2key(item): return (str(type(item)), item) > > Nope. > sorted((-1, 2, True, False)) == [-1, False, True, 2] > sorted((-1, 2, True, False)

Re: Python 3.0 - is this true?

2008-11-09 Thread Martin v. Löwis
> In any case, would it be possible to add a cmp= function which did more > or less what the current default cmp does now? As somebody pointed out, it's possible to create a key= function that provides arbitrary ordering: just return an object custom type whose __lt__ never fails: class AlwaysOrd

Re: Python 3.0 - is this true?

2008-11-09 Thread Martin v. Löwis
> def comp(x1, x2): >try: >if x1return -1 >else: >return 1 >except TypeError: >if str(x1)return -1 >else: >return 1 > Please correct me if I'm wrong, but I think this is not transitive. If strings and ints are

Re: Installing Python 2.6 on Vista

2008-11-09 Thread Fuzzyman
On Nov 9, 6:23 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > On Sun, Nov 9, 2008 at 4:14 PM, Fuzzyman <[EMAIL PROTECTED]> wrote: > > Hello guys, > > > Not sure if this is a Windows question or a Python problem... > > > I'm trying to install Python 2.6 from the msi, on Windows Vista as an > > ad

Re: Installing Python 2.6 on Vista

2008-11-09 Thread Guilherme Polo
On Sun, Nov 9, 2008 at 4:14 PM, Fuzzyman <[EMAIL PROTECTED]> wrote: > Hello guys, > > Not sure if this is a Windows question or a Python problem... > > I'm trying to install Python 2.6 from the msi, on Windows Vista as an > administrative user with UAC on. If I try to install for all users > then I

Re: Python 3.0 - is this true?

2008-11-09 Thread Martin v. Löwis
> Sure: > > if len(L1) == len(L2): > return sorted(L1) == sorted(L2) # check whether two lists contain > the same elements > else: > return False > > It doesn't really matter here what the result of the sorts actually is > as long as the algorithm leads to the same result for all permuta

Re: why am I not allowed to redefine a class ?

2008-11-09 Thread Arnaud Delobelle
Terry Reedy <[EMAIL PROTECTED]> writes: [...] > A different version of what Arnaud D. said: [...] That was much clearer! I realise now that my explanation was an order of magnitude too terse :) -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting list of complex numbers

2008-11-09 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Duncan> If you don't like the tuple then just do the two sorts separately: lst.sort(key=lambda x: x.imag) lst.sort(key=lambda x: x.real) ... I tried that. I could have sworn when I read through the output it hadn't retained the order of the r

Installing Python 2.6 on Vista

2008-11-09 Thread Fuzzyman
Hello guys, Not sure if this is a Windows question or a Python problem... I'm trying to install Python 2.6 from the msi, on Windows Vista as an administrative user with UAC on. If I try to install for all users then I am told I don't have privileges to do that... (No UAC prompt.) The only other

Re: Python 3.0 - is this true?

2008-11-09 Thread Martin v. Löwis
>> Yes, key= lets you sort anything anyway you want. >> >>> l=[1, '2', 3j] >> >>> sorted(l, key = str) >> [1, '2', 3j] > > The problem here is that str() is degenerate, i.e. a != b does not imply > str(a) != str(b). So why is this a problem? The sort algorithm is stable, so it gives a determin

Re: Python 3.0 - is this true?

2008-11-09 Thread Aahz
In article <[EMAIL PROTECTED]>, Roy Smith <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>attribution missing: >>> >>> Also, I thought that part of the python philosophy was to allow any >>> sort of object in a list, and to allow the s

Re: why am I not allowed to redefine a class ?

2008-11-09 Thread Terry Reedy
Stef Mientki wrote: hello, although this is not a real problem for me, it was caused by a copying, instead of moving, a piece of code. But I don't understand at all why the code below gives the error. class derived_class, is defined twice, the error is cuase by the second instance creation "test

Re: break up a value in a list to a list of individual items

2008-11-09 Thread Terry Reedy
r3bol wrote: Hi, sorry to post this, but I've had a really hard time finding how to do it. Q. How can I break up a value in a list to a list of individual items (preferably without importing any modules)? Like... ['12345'] (string) to [1, 2, 3, 4, 5] [numbers] You did not specify what you want

Re: is there really no good gui builder

2008-11-09 Thread Terry Reedy
Ben Finney wrote: Duncan Booth <[EMAIL PROTECTED]> writes: In effect this means that if you want to develop any commercial software with Qt you have to buy the license in advance (even if all you want is to knock together some proof-of-concept) and you are also permanently locked out from incl

Re: Python 3.0 - is this true?

2008-11-09 Thread Arnaud Delobelle
Roy Smith <[EMAIL PROTECTED]> writes: > I spend too much time in C++ pleading with the compiler to allow me to do > what I want. I come to Python to get away from all that type bondage. > > As another example, consider a list of items being juggled: > > [RubberChicken(), ChainSaw(), Canteloupe()

Re: is there really no good gui builder

2008-11-09 Thread Phil Thompson
On Sun, 09 Nov 2008 12:15:42 -0500, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Phil Thompson wrote: > >> >> The only "additional" restrictions are those imposed by the *commercial* >> license. As I said before, those restrictions are intended to discourage >> commercial developers from avoiding pa

Re: is there really no good gui builder

2008-11-09 Thread Kevin Walzer
Phil Thompson wrote: The only "additional" restrictions are those imposed by the *commercial* license. As I said before, those restrictions are intended to discourage commercial developers from avoiding paying license costs during their development phase. Is this interpretation of Qt's lice

Re: Python 3.0 - is this true?

2008-11-09 Thread Hallvard B Furuseth
Terry Reedy writes: > If you want to duplicate 2.x behavior, which does *not* work for all > types... > > def py2key(item): return (str(type(item)), item) Nope. sorted((-1, 2, True, False)) == [-1, False, True, 2] sorted((-1, 2, True, False), key=py2key) == [False, True, -1, 2] Mig

Re: replacing characters within a string

2008-11-09 Thread Terry Reedy
Chris Rebert wrote: On Sat, Nov 8, 2008 at 9:16 PM, John Smith <[EMAIL PROTECTED]> wrote: Hi, I coded a python script that lets me parse a csv file into html code with a certain format, but I would like to replace every "<" and ">" character that appears within each column entry of the csv file

Re: Finding the instance reference of an object

2008-11-09 Thread Terry Reedy
Joe Strout wrote: On Nov 8, 2008, at 2:38 PM, Terry Reedy wrote: So if you then insist that Python uses "call by object", you're actually saying it uses call by value! Both Joe and you seem to be engaging in the following bit of sophistry: "In order for code A to call code B, some informatio

Re: Python 3.0 - is this true?

2008-11-09 Thread Hallvard B Furuseth
Steven D'Aprano writes: > How often do you care about equality ignoring order for lists containing > arbitrary, heterogeneous types? Arbitrary, I never have. Different types of my choice, a few times. I was only interested in there being some _sort_ order (and the same in different runs of the p

Re: Finding the instance reference of an object

2008-11-09 Thread Terry Reedy
greg wrote: No. Passing q by value means that the value of the expression 'q', whatever that is in the language concerned, gets assigned to the local variable 'p', whatever *that* means in the language concerned. In other words, as I acknowledged in my other post, one can say that all calling

Re: Python 3.0 - is this true?

2008-11-09 Thread Terry Reedy
Kay Schluehr wrote: On 9 Nov., 05:04, Terry Reedy <[EMAIL PROTECTED]> wrote: Have you written any Python code where you really wanted the old, unpredictable behavior? Sure: I was asking the OP ;-) if len(L1) == len(L2): return sorted(L1) == sorted(L2) # check whether two lists conta

Re: is there really no good gui builder

2008-11-09 Thread Phil Thompson
On 9 Nov 2008 14:40:22 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > >>> It is a novel interpretation of the GPL. Qt Software have every >>> right to impose this sort of condition, but it makes me want to >>> avoid them. >> >> No, they have no such right to interpret the GPL t

Re: Python 3.0 - is this true?

2008-11-09 Thread Marc 'BlackJack' Rintsch
On Sun, 09 Nov 2008 10:45:31 -0500, Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Roy Smith schrieb: >>> In article <[EMAIL PROTECTED]>, >>> "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>> >> When I wrote "uniform" I meant objects of the

Re: Python 3.0 - is this true?

2008-11-09 Thread Marc 'BlackJack' Rintsch
On Sun, 09 Nov 2008 10:45:31 -0500, Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Roy Smith schrieb: >>> In article <[EMAIL PROTECTED]>, >>> "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>> >> When I wrote "uniform" I meant objects of the

Re: Python 3.0 - is this true?

2008-11-09 Thread Marc 'BlackJack' Rintsch
On Sun, 09 Nov 2008 10:45:31 -0500, Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Roy Smith schrieb: >>> In article <[EMAIL PROTECTED]>, >>> "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>> >> When I wrote "uniform" I meant objects of the

Re: Python 3.0 - is this true?

2008-11-09 Thread Marc 'BlackJack' Rintsch
On Sun, 09 Nov 2008 10:45:31 -0500, Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Roy Smith schrieb: >>> In article <[EMAIL PROTECTED]>, >>> "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>> >> When I wrote "uniform" I meant objects of the

Re: Python 3.0 - is this true?

2008-11-09 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Duncan Booth <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: > > > In 3.0, can you still order types? In 2.x, you can do: > > > t1 = type(1) > t2 = type(1j) > t1 < t2 > > False > > > > If this still works in 3.0, then you can easily do something like

Re: Python 3.0 - is this true?

2008-11-09 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Roy Smith schrieb: > > In article <[EMAIL PROTECTED]>, > > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > >>> Also, I thought that part of the python philosophy was to allow any > >>> sort of object in a list,

Re: Python 3.0 - is this true?

2008-11-09 Thread Stefan Behnel
Duncan Booth wrote: > Roy Smith wrote: > >> In 3.0, can you still order types? In 2.x, you can do: >> > t1 = type(1) > t2 = type(1j) > t1 < t2 >> False >> >> If this still works in 3.0, then you can easily do something like: >> >> def total_order(o1, o2): >>"Compare any two object

Re: sorting list of complex numbers

2008-11-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: The thread on sorting in Python 3 got me to thinking. How could I sort a list of complex numbers using key? >>> lst = [random.random()+random.random()*1j for i in range(10)] >>> lst [(0.32672251849959244+0.41428983433288791j), (0.35238056484609881+0.92758

Re: Python 3.0 - is this true?

2008-11-09 Thread Diez B. Roggisch
Roy Smith schrieb: In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: Also, I thought that part of the python philosophy was to allow any sort of object in a list, and to allow the same methods to work with whatever was in list. Not really. When the usual argument ab

Re: sorting list of complex numbers

2008-11-09 Thread skip
>> Is there a way to do this using just the key arg, no extra data >> structures? Duncan> Is a tuple an extra data structure? lst.sort(key=lambda x: (x.real,x.imag)) pprint.pprint(lst) Duncan> [2.6001j, Duncan> 20j, Duncan> (1+2.73j), D

Re: is there really no good gui builder

2008-11-09 Thread David Boddie
On Sunday 09 November 2008 13:45, Ben Finney wrote: > Duncan Booth <[EMAIL PROTECTED]> writes: > >> Mr.SpOOn wrote: >> > What's the problem with qt licence? >> >> "You must purchase a Qt Commercial License from Qt Software or from >> one of its authorized resellers before you start developing >>

Re: My first Python program -- a lexer

2008-11-09 Thread Thomas Mlynarczyk
Arnaud Delobelle schrieb: Adding to John's comments, I wouldn't have source as a member of the Lexer object but as an argument of the tokenise() method (which I would make public). The tokenise method would return what you currently call self.result. So it would be used like this. mylexer =

Re: sorting list of complex numbers

2008-11-09 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > I can sort by the real parts just fine: > > >>> lst.sort(key=lambda x: x.real) > >>> pprint.pprint(lst) > [2.6001j, > 20j, > (1+2.73j), > (1+21j), > (2+2.8603j), > (2+22j), > (3+2.9902j), >

Re: break up a value in a list to a list of individual items

2008-11-09 Thread r3bol
thanks :) and so many different ways! -- http://mail.python.org/mailman/listinfo/python-list

Re: is there really no good gui builder

2008-11-09 Thread Duncan Booth
Ben Finney wrote: >> It is a novel interpretation of the GPL. Qt Software have every >> right to impose this sort of condition, but it makes me want to >> avoid them. > > No, they have no such right to interpret the GPL this way; it would be > entirely incompatible with the GPL since it would be a

Re: Python 3.0 - is this true?

2008-11-09 Thread Duncan Booth
Roy Smith wrote: > In 3.0, can you still order types? In 2.x, you can do: > t1 = type(1) t2 = type(1j) t1 < t2 > False > > If this still works in 3.0, then you can easily do something like: > > def total_order(o1, o2): >"Compare any two objects of arbitrary types" >try: >

  1   2   >