Re: New docs for set elements/dictionary keys (Was: Why is dictionary.keys() a list and not a set?)

2005-11-26 Thread Martin v. Löwis
Mike Meyer wrote: > Personally, I think we'd be better off to come up with a term for this > property that doesn't have a commonly understood meaning that has such > broad areas of disagreement with the property. I've been using > "hashable", which I would currently define as "has a __hash__ method

Re: SOAP - Beginner Desperately looking for Help

2005-11-26 Thread Rodney Garland
Thanks :-) "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> I wanted to attach these - however, taht didn't work for NNTP, so I mail >> them to you. > > Didn't work - my mail server won't let me send these to you. So you're on > your own here. Shouldn't be too

interactive prompts

2005-11-26 Thread Michael Williams
Hi all, I'm having an issue with environment variables and spawned commands. Specifically, I'm using "eval `ssh-agent`" and "ssh-add". My question is, how do I force the environmental variables set by one 'popen' or 'pexpect' to propagate throughout the entire Python session so that any

Re: Which License Should I Use?

2005-11-26 Thread [EMAIL PROTECTED]
First thing first, you need to find out if you are an "employee", not in the normal sense, but legal sense. This directly affect the copyright issue, outside your "work hours". If you need their consent on take on other clients, that would be iffy. There are a number of things a court would look

Re: Syntax

2005-11-26 Thread Terry Hancock
On Sat, 26 Nov 2005 20:54:49 -0800 Robert Kern <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > So, two options: > > > > from os import * > > import os > > One of these two ways you're not supposed to use for > > security reasons, but I'm spacing on which one. > > I don't think there ar

why?

2005-11-26 Thread teimu . tm
ive been using python for about two years now, and cant think of an instance where i would need that functionality. Dictionaries arent supposed to be ordered...they provide object associations, and simply that. Whatever your trying to do in pythonTMTOWTDI -- http://mail.python.org/mailman/lis

Weekly Python Patch/Bug Summary

2005-11-26 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 372 open ( -7) / 2980 closed (+12) / 3352 total ( +5) Bugs: 908 open ( -2) / 5395 closed (+11) / 6303 total ( +9) RFE : 200 open ( +0) / 191 closed ( +0) / 391 total ( +0) New / Reopened Patches __ CodeConte

Re: Crash in python while run from U3 device

2005-11-26 Thread Philippe C. Martin
PS: I should add that the U3 device does not actually run Python, but copies it to the PC and launches it: I'm almost certain this is a bug in my code. Help please ! Regards, Philippe Philippe C. Martin wrote: > Hi, > > I am currently porting some of my applications to U3 (www.u3.com) and I

Re: Whitespace test after string.split

2005-11-26 Thread Bengt Richter
On Sat, 26 Nov 2005 16:15:17 +0100, Peter Otten <[EMAIL PROTECTED]> wrote: >David Pratt wrote: > >> Hi. I am splitting a string on a non whitespace character. One or more >> whitespace characters can be returned as items in the list. I do not >> want the items in the list that are only whitespace

Re: wxPython Licence vs GPL

2005-11-26 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 26 Nov 2005 18:18:44 -0500, Mike Meyer wrote: >> So that's the basis of the disagreement. I'm using "restriction" with >> the intent of communicating it's normal english meaning, > Your meaning is about as far from the plain English sense of "r

Re: Syntax

2005-11-26 Thread Robert Kern
[EMAIL PROTECTED] wrote: > If you use 'from os import *' then you shouldn't preface the commands > with os. > > So, two options: > > from os import * > print "Working Path: %s" % getcwd() > > OR > > import os > print "Working Path: %s" % os.getcwd() > > One of these two ways you're not suppose

Re: wxPython Licence vs GPL

2005-11-26 Thread Steven D'Aprano
On Sat, 26 Nov 2005 18:18:44 -0500, Mike Meyer wrote: > The GPL is *not* such a license - it places > restrictions on the redistribution. Which is what I said in the first > place. If you want me to agree that the GPL puts more conditions on distribution than the MIT/BSD licence, then I'll happil

Syntax

2005-11-26 Thread calad . sigilon
If you use 'from os import *' then you shouldn't preface the commands with os. So, two options: from os import * print "Working Path: %s" % getcwd() OR import os print "Working Path: %s" % os.getcwd() One of these two ways you're not supposed to use for security reasons, but I'm spacing on whi

Re: Why are there no ordered dictionaries?

2005-11-26 Thread Bengt Richter
On Fri, 25 Nov 2005 19:42:49 +, Tom Anderson <[EMAIL PROTECTED]> wrote: >On Wed, 23 Nov 2005, Carsten Haese wrote: > >> On Wed, 2005-11-23 at 15:17, Christoph Zwerschke wrote: >>> Bengt Richter wrote: >>> >>> > E.g., it might be nice to have a mode that assumes d[key] is >>> d.items()[k][1] wh

Re: Nested list comprehensions

2005-11-26 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hey guys: > [(i,j,k) for i in range(1,j) for j in range(1,k) for k in range(1,5)] > [(1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 1, 4), (1, 2, 1), (1, 2, 2), (1, > 2, 3), (1, 2, 4), (1, 3, 1), (1, 3, 2), (1, 3, 3), (1, 3, 4), (2, 1, > 1), (2, 1, 2), (2, 1, 3), (2, 1, 4), (

Re: Nested list comprehensions

2005-11-26 Thread Carl Waldbieser
[EMAIL PROTECTED] wrote: > Hey guys: > [(i,j,k) for i in range(1,j) for j in range(1,k) for k in range(1,5)] > [(1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 1, 4), (1, 2, 1), (1, 2, 2), (1, > 2, 3), (1, 2, 4), (1, 3, 1), (1, 3, 2), (1, 3, 3), (1, 3, 4), (2, 1, > 1), (2, 1, 2), (2, 1, 3), (2, 1, 4),

Re: Why are there no ordered dictionaries?

2005-11-26 Thread Bengt Richter
On Thu, 24 Nov 2005 18:42:45 +0100, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >Bengt Richter schrieb: > >>>d.setvalues((13, 14)) ==> d = OrderedDict((1, 13), (2, 14)) > >> The implication above is that OrderedDict takes an *args argument, >> but really it takes a single argument that is a se

Re: CGI question

2005-11-26 Thread Mike Meyer
Dan Stromberg <[EMAIL PROTECTED]> writes: > On Sat, 26 Nov 2005 13:26:11 +0100, Fredrik Lundh wrote: >> Dan Stromberg wrote: >>> What's the best way of converting this: >>> 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 >>> 14:48' >>> ...to something easil

Nested list comprehensions

2005-11-26 Thread neildunn
Hey guys: >>> [(i,j,k) for i in range(1,j) for j in range(1,k) for k in range(1,5)] [(1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 1, 4), (1, 2, 1), (1, 2, 2), (1, 2, 3), (1, 2, 4), (1, 3, 1), (1, 3, 2), (1, 3, 3), (1, 3, 4), (2, 1, 1), (2, 1, 2), (2, 1, 3), (2, 1, 4), (2, 2, 1), (2, 2, 2), (2, 2, 3), (2,

Re: Call OCX from python?

2005-11-26 Thread Claudio Grondi
"JustSomeGuy" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hi I have a commercial OCX that I want to use in > my python application. How do I call OCXs from > python? > TIA import win32com.client axOCX = win32com.client.Dispatch("RegistryEntryForThisOCXin[VersionIndependent

scanl in python

2005-11-26 Thread [EMAIL PROTECTED]
>I think that the test for an empty iterator makes ireduce() unintuitive. Try >asking someone who has not followed the discussion >what list(ireduce(add, [], 42)) might produce, given that >list(ireduce(add, [1], 42)) --> [43] >list(ireduce(add, [1, 2], 42)) --> [43, 45] >list(ireduce(add, [])) --

Re: SOAP - Beginner Desperately looking for Help

2005-11-26 Thread Diez B. Roggisch
> I wanted to attach these - however, > taht didn't work for NNTP, so I mail them to you. Didn't work - my mail server won't let me send these to you. So you're on your own here. Shouldn't be too hard :) Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: SOAP - Beginner Desperately looking for Help

2005-11-26 Thread Diez B. Roggisch
Rodney Garland wrote: > Hi All, > > I am a relative beginner to Python and am looking for help with sending and > XML message and getting back a return file. The server is: > > https://node.deq.state.or.us/node/node.asmx > > I have have successfully sent and recieved using the PING, AUTHENTICA

Re: CGI question

2005-11-26 Thread Dan Stromberg
On Sat, 26 Nov 2005 13:26:11 +0100, Fredrik Lundh wrote: > Dan Stromberg wrote: > >> What's the best way of converting this: >> >> 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 >> 14:48' >> >> ...to something easily usable in a python CGI script? > > e

Re: Comparison problem

2005-11-26 Thread Alex Martelli
Tom Anderson <[EMAIL PROTECTED]> wrote: ... > But, more importantly, egad! What's the thinking behind having slicing > behave like that? Anyone got any ideas? What's the use case, as seems to > be the fashionable way of putting it these days? :) Slicing has always been "soft" (it's OK to specif

Re: 2d array slicing problem

2005-11-26 Thread Robert Kern
Tune Kamae (sent by Nabble.com) wrote: > I am thinking to upgrade my desktop to 64bit cpu with 16GB memory to handle > large astronomical images and data. I wonder if > 1) the latest numarry (besides 2d slicing) has been tested with one or more > 64 bit CPU and Linux distributions Certainly.

Re: Comparison problem

2005-11-26 Thread Peter Hansen
Tom Anderson wrote: > On Sat, 26 Nov 2005, Peter Hansen wrote: >>Tom Anderson wrote: >>>On Sat, 26 Nov 2005, Chris wrote: if item[0:1]=="-": >>> >>>item[0:1] seems a rather baroque way of writing item[0]! I'd actually >>>suggest writing this line like this: >> >>Actually, it's not so much ba

New docs for set elements/dictionary keys (Was: Why is dictionary.keys() a list and not a set?)

2005-11-26 Thread Mike Meyer
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>>This is not true. The second definition of __hash__ does not meet >>>the specifications: >> The specification isn't on the __hash__ method, but on objects. > What does it mean for a specification to be "on" something? The > specif

SOAP - Beginner Desperately looking for Help

2005-11-26 Thread Rodney Garland
Hi All, I am a relative beginner to Python and am looking for help with sending and XML message and getting back a return file. The server is: https://node.deq.state.or.us/node/node.asmx I have have successfully sent and recieved using the PING, AUTHENTICATE (send in username and password and

Re: 2d array slicing problem

2005-11-26 Thread Tune Kamae (sent by Nabble.com)
I am thinking to upgrade my desktop to 64bit cpu with 16GB memory to handle large astronomical images and data.  I wonder if 1) the latest numarry (besides 2d slicing) has been tested with one or more     64 bit CPU and Linux distributions 2) with 64 bit address space, will numarray be able to h

Re: Comparison problem

2005-11-26 Thread Tom Anderson
On Sat, 26 Nov 2005, Peter Hansen wrote: > Tom Anderson wrote: >> On Sat, 26 Nov 2005, Chris wrote: >> >>> if item[0:1]=="-": >> >> item[0:1] seems a rather baroque way of writing item[0]! I'd actually >> suggest writing this line like this: > > Actually, it's not so much baroque as it is saf

Re: Comparison problem

2005-11-26 Thread Peter Hansen
Tom Anderson wrote: > On Sat, 26 Nov 2005, Chris wrote: > >> if item[0:1]=="-": > > item[0:1] seems a rather baroque way of writing item[0]! I'd actually > suggest writing this line like this: Actually, it's not so much baroque as it is safe... item[0] will fail if the string is empty, while

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Martin v. Löwis
Mike Meyer wrote: >>This is not true. The second definition of __hash__ does not meet >>the specifications: > > > The specification isn't on the __hash__ method, but on objects. What does it mean for a specification to be "on" something? The specification I quoted is listed "under" the __hash__

Re: Cheapest pocket device to code python on

2005-11-26 Thread Ten
On Friday 04 November 2005 03:55, [EMAIL PROTECTED] wrote: > What is the cheapest/affordable pocket device that I can code python > on? I think the closest I have seen is pocketpc from this page: > > http://www.murkworks.com/Research/Python/PocketPCPython/Overview Depends what you're using it for,

Re: Which License Should I Use?

2005-11-26 Thread Ben Finney
Jorgen Grahn <[EMAIL PROTECTED]> wrote: > Tom Anderson <[EMAIL PROTECTED]> wrote: > > The logic, i think, is that the freedom of the code is the key to > > the freedom of the end-users: applying the GPL to your code means > > that other programmers will be forced to apply to to their code, > > whic

Re: wxPython Licence vs GPL

2005-11-26 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 26 Nov 2005 04:46:15 -0500, Mike Meyer wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> But if you *do* redistribute it, then you must live up to conditions in >>> the licence. If you aren't willing to do that, use software with a >>> d

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Mike Meyer
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>>class mylist1(list): >>> def __hash__(self): return 0815 >>> >>>class mylist2(list): >>> def __hash__(self): return id(self) >>> >>>In the case of mylist1, everything is ok including semantics, but >>>performance suffers d

Dr. Dobb's Python-URL! - weekly Python news and links (Nov 26)

2005-11-26 Thread Cameron Laird
QOTW: "... '[B]ut assume that I have some other use case' isn't a valid use case". - Fredrik Lundh "Rolling your own solution, on the other hand, can end in a long road discovering what those CORBA people were doing for all those years." - Paul Boddie NOTW: sceptifications. Steven D'Apra

Re: Which License Should I Use?

2005-11-26 Thread Robert Kern
mojosam wrote: > I would have to talk to a lawyer to be sure, but right now, I think I > can argue that anything I do on my own time belongs to me. I'm > technically a consultant right now (even though I'm spending 40 > hours/week with the one "client"). I can take on other clients, as > long as

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Martin v. Löwis
Christoph Zwerschke wrote: >> This is not true. The second definition of __hash__ does not meet >> the specifications: >> "The only required property is that objects which compare equal have the >> same hash value" > > > As Mike has written in his last posting, you could easily "fix" that by > t

Re: Crash in python while run from U3 device

2005-11-26 Thread Philippe C. Martin
Philippe C. Martin wrote: > Hi, > > I am currently porting some of my applications to U3 (www.u3.com) and I do > get a crash in ...objects\frameobject.c: PyFrameObject *back = > tstate->frame. > > The point of the current test is to get a python function called on a U3 > device event. (U3 only w

Re: Which License Should I Use?

2005-11-26 Thread mojosam
Thanks to everyone so far. You've helped a lot. (BTW, I read this through Google Groups. Somehow they've gotten about 24 hours behind, so I'm seeing your replies a day late.) The biggest misconception I had was that the license could force the code to stay open source. You're right. What I do

Re: Call OCX from python?

2005-11-26 Thread Do Re Mi chel La Si Do
>From WxPython, or from PythonWin. Other way : call, & drive, Internet-Explorer, who call the ocx. Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Christoph Zwerschke
>>> class mylist1(list): >>> def __hash__(self): return 0815 >>> >>> class mylist2(list): >>> def __hash__(self): return id(self) >>> >>> Which of these user-defined types would you call "hashable"? > Mike Meyer wrote: >> The latter two, as the given __hash__ meets the specifications for

Using SSL in socket module.

2005-11-26 Thread Carl Waldbieser
I am trying to understand how the SSL object in the socket module is supposed to be used. From looking at the documentation, I can work out that you need to pass a socket into the ssl() function, and you get back an SSL object that has write() and read() methods similar to a file object. However,

Call OCX from python?

2005-11-26 Thread JustSomeGuy
Hi I have a commercial OCX that I want to use in my python application. How do I call OCXs from python? TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP over TLS

2005-11-26 Thread Carl Waldbieser
David Isaac wrote: > > "Carl Waldbieser" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Does anyone know of any good examples for writing client side code to > upload >> files over a secure FTP connection? > > http://trevp.net/tlslite/ > > Alan Isaac Thanks. I have actually

Re: Persist a class (not an instance)

2005-11-26 Thread Phillip J. Eby
David Wahler wrote: > Kent Johnson wrote: > > Is there a way to persist a class definition (not a class instance, > > the actual class) so it can be restored later? A naive approach > > using pickle doesn't work: > [snip] > > The idea is to persist classes that are created and modified at runtime

Re: icmp - should this go in itertools?

2005-11-26 Thread Tom Anderson
On Sat, 26 Nov 2005, Diez B. Roggisch wrote: > Tom Anderson wrote: > >> Is this any good? Would it be any use? Should this be added to itertools? > > Whilst not a total itertools-expert myself, I have one little objection > with this: the comparison won't let me know how many items have been > c

Re: wxPython Licence vs GPL

2005-11-26 Thread Martin P. Hellwig
Steven D'Aprano wrote: > > > I think you are over-estimating both the numbers and profitability of such > niche software distributors, and misunderstanding the business models of > them. Coincidently, I worked at a software company making a "standard" administration software for primary school

Re: icmp - should this go in itertools?

2005-11-26 Thread Tom Anderson
On Fri, 25 Nov 2005, Roy Smith wrote: > Tom Anderson <[EMAIL PROTECTED]> wrote: > >> It's modelled after the way cmp treats lists - if a and b are lists, >> icmp(iter(a), iter(b)) should always be the same as cmp(a, b). >> >> Is this any good? Would it be any use? Should this be added to itertools

Re: Comparison problem

2005-11-26 Thread Tom Anderson
Chris, as well as addressing what i think is causing your problem, i'm going to point out some bits of your code that i think could be polished a little. It's intended in a spirit of constructive criticism, so i hope you don't mind! On Sat, 26 Nov 2005, Chris wrote: >if item[0:1]=="-": it

Re: icmp - should this go in itertools?

2005-11-26 Thread Jorgen Grahn
On Fri, 25 Nov 2005 21:58:00 -0500, Roy Smith <[EMAIL PROTECTED]> wrote: > Tom Anderson <[EMAIL PROTECTED]> wrote: > >> It's modelled after the way cmp treats lists - if a and b are lists, >> icmp(iter(a), iter(b)) should always be the same as cmp(a, b). >> >> Is this any good? Would it be any us

Re: Which License Should I Use?

2005-11-26 Thread Jorgen Grahn
On Sat, 26 Nov 2005 00:13:10 +, Tom Anderson <[EMAIL PROTECTED]> wrote: ... > freedom - 'free software', 'free as in speech', etc. What you have to > realise is that they're not talking about the freedom of the programmers, > but about the freedom of the software. The logic, i think, is that

Re: Which License Should I Use?

2005-11-26 Thread Jorgen Grahn
On 25 Nov 2005 11:30:46 -0800, mojosam <[EMAIL PROTECTED]> wrote: ... > How do I decide on a license? Are there any web sites that summarize > the pros and cons? I like this list: http://www.gnu.org/licenses/license-list.html It's from a GPL perspective of course, but pretty balanced I think.

Tkinter on mac - Binding command-q to quit application

2005-11-26 Thread Brandon
Hi All, I'm attempting to develop a Tcl/Tk application on the mac using python and Tkinter. The one problem I'm having is adding basic keyboard support to my application, specifically binding command-q so that it quits the application (this is standard behavior for almost every mac application, t

Crash in python while run from U3 device

2005-11-26 Thread Philippe C. Martin
Hi, I am currently porting some of my applications to U3 (www.u3.com) and I do get a crash in ...objects\frameobject.c: PyFrameObject *back = tstate->frame. The point of the current test is to get a python function called on a U3 device event. (U3 only work with Windows currently). My C stub cal

Re: Dynamic classes

2005-11-26 Thread Dave Rose
Duh! how dumb am I? A dictionary solves all those problems, with each entry named, and the value of each name could be a class instace. plus all the class instances can be iterated by a loop. Thanks Piet & Alex for your guidance! -Dave "Piet van Oostrum" <[EMAIL PROTECTED]> wrote in message

Comparison problem

2005-11-26 Thread Chris
Hi, I'm new to python, and I'm trying to write a small python script for a webpage. The script opens up a file called inventory, reads the contents, and checks the contents against the data from the form in my webpage. Now I have to do some slicing to get the name of the form elements (in this c

Re: How to get started in GUI Programming?

2005-11-26 Thread Luis M. Gonzalez
Try PythonCard (http://pythoncard.sf.net). Like VB or Delphi (drag and drop widgets), but much simpler, easy and fun. It's based on wxWidgets, and it gives your apps a native look, no matter your platform (much nicer than Tkinter, which looks uglier and dated). -- http://mail.python.org/mailman/l

forum

2005-11-26 Thread Henri Stryd
What is this what I get om my screen? does it have anything to do with the Sam Francke who has that beautiful genealogical entry? Answer at: [EMAIL PROTECTED] Henri. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get started in GUI Programming?

2005-11-26 Thread Rembrant
ok i'm begginer in programing but i found some online books so you'll probably find in them what you need! Just send me a mail and i'll reply with the address! hope this can be helpfull... -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get started in GUI Programming?

2005-11-26 Thread Jonathan Gardner
I would argue with your assertion that either TKinter of PyGTK are the best. There are several other good alternatives, including wxPython and PyQt, which are very comparable, if not better. I would strongly suggest starting with PyQt. It's my personal favorite. I wrote a short tutorial on the Pyt

Re: Stealing focus: emacs, and PIL, in Windows

2005-11-26 Thread Graham Fawcett
[EMAIL PROTECTED] wrote: > I'm using GNU Emacs 21.3.1 with python-mode 1.0alpha under Windows XP. > Whenever I execute a command in an edit window (with > py-execute-region), the output window steals the focus. How can I stop > this happening? [snip] > I commented out the command > (pop-to-buffer

Re: Whitespace test after string.split

2005-11-26 Thread David Pratt
Hi Fredrik. Good to know. Many thanks for your replies. Regards David On Saturday, November 26, 2005, at 12:27 PM, Fredrik Lundh wrote: > David Pratt wrote: > >> Also thanks for heads up for changes with method. I am >> still using 2.3 but will move to 2.4 as soon as this is formally >> approv

Re: wxPython Licence vs GPL

2005-11-26 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > >> Apart from Microsoft, and possibly Quark (makers of Quark Express desktop > >> packaging software), and perhaps a few console game developers, is there > >> any company making a profit on software sales? > > > > I believe Oracle is doing fine

Re: Whitespace test after string.split

2005-11-26 Thread Fredrik Lundh
David Pratt wrote: > Also thanks for heads up for changes with method. I am > still using 2.3 but will move to 2.4 as soon as this is formally > approved for use in Zope. note that the string.split function has been "outdated" since Python 1.6 (released in 2000), and despite what the documentati

Re: Whitespace test after string.split

2005-11-26 Thread David Pratt
Hi Fredrik and Peter. Many thanks for this helpful advice :-) These are very nice solutions and much better than what I had been contemplating. Also thanks for heads up for changes with method. I am still using 2.3 but will move to 2.4 as soon as this is formally approved for use in Zope. Re

Re: Writing pins to the RS232

2005-11-26 Thread Paul Watson
[EMAIL PROTECTED] wrote: > I want to write to the pins of an RS232 without using the serial > protocol. The use would be every pin could act to complete a circuit > in customized hardware. I could use python to communicate serially to > a BASIC stamp or a Javelin stamp and then use the stamp to s

Re: Whitespace test after string.split

2005-11-26 Thread Fredrik Lundh
Peter Otten wrote: [t.strip() for t in s.split(",") if t and not t.isspace()] > ['alpha', 'gamma', 'delta'] footnote: this solution is faster than my filter version. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython Licence vs GPL

2005-11-26 Thread Fredrik Lundh
Steven D'Aprano wrote: > Fine. If you want to take rights away from the people you redistribute > somebody else's software to, then the GPL is not for you. the people you distribute somebody else's open source software to still have the same rights to that software as you have. GPL or not GPL do

Re: Whitespace test after string.split

2005-11-26 Thread Fredrik Lundh
David Pratt wrote: > Hi. I am splitting a string on a non whitespace character. One or more > whitespace characters can be returned as items in the list. I do not > want the items in the list that are only whitespace (can be one or more > characters of whitespace) and plan to use string.strip on

Re: Whitespace test after string.split

2005-11-26 Thread Peter Otten
David Pratt wrote: > Hi. I am splitting a string on a non whitespace character. One or more > whitespace characters can be returned as items in the list. I do not > want the items in the list that are only whitespace (can be one or more > characters of whitespace) and plan to use string.strip on

Whitespace test after string.split

2005-11-26 Thread David Pratt
Hi. I am splitting a string on a non whitespace character. One or more whitespace characters can be returned as items in the list. I do not want the items in the list that are only whitespace (can be one or more characters of whitespace) and plan to use string.strip on those items that are not

Re: wxPython Licence vs GPL

2005-11-26 Thread Steven D'Aprano
On Sat, 26 Nov 2005 04:46:15 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> But if you *do* redistribute it, then you must live up to conditions in >> the licence. If you aren't willing to do that, use software with a >> different licence. > > That's a restriction on r

Re: Making immutable instances

2005-11-26 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 26 Nov 2005 04:59:59 -0500, Mike Meyer wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> On Fri, 25 Nov 2005 23:20:05 -0500, Mike Meyer wrote: If you've got a use case, I'd be interested in hearing it. >>> frozenset perhaps? If it w

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Martin v. Löwis
Mike Meyer wrote: >>class mylist1(list): >> def __hash__(self): return 0815 >> >>class mylist2(list): >> def __hash__(self): return id(self) >> >>In the case of mylist1, everything is ok including semantics, but >>performance suffers dramatically. In mylist2, performance is great, >>but sem

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Mike Meyer
Christoph Zwerschke <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > > I think you're trying to tweak the wrong definition. Types are > > immutable if their instances are immutable. > I'm not trying to tweak it, but to gain more clarity about what is > actually meant when you talk about "mutable

Re: Making immutable instances

2005-11-26 Thread Steven D'Aprano
On Sat, 26 Nov 2005 04:59:59 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> On Fri, 25 Nov 2005 23:20:05 -0500, Mike Meyer wrote: >>> If you've got a use case, I'd be interested in hearing it. >> frozenset perhaps? If it were needed once, it could be needed again. > > T

Re: Hello World-ish

2005-11-26 Thread Jesse Lands
On 26 Nov 2005 03:19:55 -0800 "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > from os import * > print "Working path: %s" % os.getcwd(); > > Just wondering how you would do that .. in theory, if you get what I > mean? > I get > NameError: name 'os' is not defined > currently, which I don't know

Re: CGI question

2005-11-26 Thread Fredrik Lundh
Dan Stromberg wrote: > What's the best way of converting this: > > 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 > 14:48' > > ...to something easily usable in a python CGI script? easily usable for what purpose? if you want to extract the URL that seem

Re: icmp - should this go in itertools?

2005-11-26 Thread Diez B. Roggisch
Tom Anderson wrote: > Hi all, > > This is a little function to compare two iterators: > > > > def icmp(a, b): > for xa in a: > try: > xb = b.next() > d = cmp(xa, xb) > if (d != 0): > return d > except StopIteration: >

Re: wxPython Licence vs GPL

2005-11-26 Thread Steven D'Aprano
On Sat, 26 Nov 2005 11:26:30 +0100, Martin P. Hellwig wrote: > Steven D'Aprano wrote: >> On Thu, 24 Nov 2005 17:43:22 +0100, Martin P. Hellwig wrote: >> >>> if I owned a company >>> making profit on software sales (sale =! support) you sign a death wish >>> for using GPL >> >> Apart from Micro

Re: Hello World-ish

2005-11-26 Thread Jorge Godoy
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > from os import * > print "Working path: %s" % os.getcwd(); > > Just wondering how you would do that .. in theory, if you get what I > mean? > I get > NameError: name 'os' is not defined > currently, which I don't know how to fix.. anyone? Either:

Hello World-ish

2005-11-26 Thread [EMAIL PROTECTED]
from os import * print "Working path: %s" % os.getcwd(); Just wondering how you would do that .. in theory, if you get what I mean? I get NameError: name 'os' is not defined currently, which I don't know how to fix.. anyone? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Christoph Zwerschke
Mike Meyer wrote: > I think you're trying to tweak the wrong definition. Types are > immutable if their instances are immutable. I'm not trying to tweak it, but to gain more clarity about what is actually meant when you talk about "mutable" types and objects and whether it suffices to use the

Re: wxPython Licence vs GPL

2005-11-26 Thread Chris F.A. Johnson
On 2005-11-26, Steven D'Aprano wrote: > > If you don't like that clause, you have two very simple options: don't > redistribute the GPLed software. Or use some other software provided under > a different licence. There is a third option: persuade the owner of the copyright to give you a di

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Christoph Zwerschke
Mike Meyer wrote: > Ok, how about this for dictionaries/sets: > > Any hashable object can be used as a dictionary key (set member). Immutable > objects, except for tuples that contain a non-hashable object, are > hashable. Python classes are normally hashable(1). The problem with the last senten

Re: Profiling with hotshot and wall clock time

2005-11-26 Thread Dieter Maurer
Geert Jansen <[EMAIL PROTECTED]> writes on Thu, 24 Nov 2005 21:33:03 +0100: > ... > Is possible to use hotshot with wall clock time, i.e. is it possible > to have the code fragment below show one second as opposed to zero? > The old profiler seems to have functionality choosing a timer function >

Re: wxPython Licence vs GPL

2005-11-26 Thread Martin P. Hellwig
Steven D'Aprano wrote: > On Thu, 24 Nov 2005 17:43:22 +0100, Martin P. Hellwig wrote: > >> if I owned a company >> making profit on software sales (sale =! support) you sign a death wish >> for using GPL > > Apart from Microsoft, and possibly Quark (makers of Quark Express desktop > packaging s

Re: Which License Should I Use?

2005-11-26 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > Simply assuming that because you have developed the code "in your own > time" you have sole rights to it, or even a right to redistribute, is > likely to lead to trouble and I would recommend against that course of > action. The employment agreement may s

Re: Which License Should I Use?

2005-11-26 Thread Steven D'Aprano
On Fri, 25 Nov 2005 11:30:46 -0800, mojosam wrote: > I guess I don't care too much about how other people use it. Then probably the best licence to use is just to follow the lead of Python. For that sort of small program of limited value, I put something like this in the code: Copyright (c) 2005

Re: wxPython Licence vs GPL

2005-11-26 Thread Martin P. Hellwig
Steven D'Aprano wrote: > On Thu, 24 Nov 2005 23:26:38 +0100, Martin P. Hellwig wrote: > >> BSD/MIT style license is a >> good substitute of no license at all. > > But that's not true: "no licence at all" means that nobody has the right > to use or copy or even *see* your work. You can, of course

Re: Making immutable instances

2005-11-26 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 25 Nov 2005 23:20:05 -0500, Mike Meyer wrote: >> If you've got a use case, I'd be interested in hearing it. > frozenset perhaps? If it were needed once, it could be needed again. That's not a use case, that's an example. And not a very good one

Re: Python as Guido Intended

2005-11-26 Thread Mike Meyer
Paul Rubin writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> Those two statements say the same thing. Part of the Python philosphy, >> from "import this", is that there should only be one obvious way to do >> it. By enabling that part of Python's philosphy, you're autom

Re: wxPython Licence vs GPL

2005-11-26 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > But if you *do* redistribute it, then you must live up to conditions in > the licence. If you aren't willing to do that, use software with a > different licence. That's a restriction on redistribution. > The only restriction is that you can't give th

Re: wxPython Licence vs GPL

2005-11-26 Thread Steven D'Aprano
On Fri, 25 Nov 2005 20:54:55 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> On Thu, 24 Nov 2005 16:00:29 -0500, Mike Meyer wrote: >> The GPL doesn't restrict distribution. I don't understand where >> people get this bizarre view of the GPL from.> > > It happens because

Re: wxPython Licence vs GPL

2005-11-26 Thread Steven D'Aprano
On Sat, 26 Nov 2005 03:25:58 +, Ed Jensen wrote: > Paul Rubin wrote: >> Python and *BSD are getting far less volunteer development love than, >> say, GCC or Linux, and the licensing is at least part of the reason. > > I disagree. I believe *BSD gets less volunteer

Re: Which License Should I Use?

2005-11-26 Thread Steve Holden
mojosam wrote: > I've been watching the flame war about licenses with some interest. > There are many motivations for those who participate in this sector, so > disagreements over licenses reflect those agendas. > > I don't have an agenda, at least not right now. I do plan on writing a > few prog

Re: Unicode in MIMEText

2005-11-26 Thread Steve Holden
Damjan wrote: >>... and being concerned to improve the library you logged this patch in >>Sourceforge for consideration by the developers? >> >>That's the only way to guarantee proper consideration of your fix. > > > Ok I will, can you confirm that the patch is correct? > Maybe I got something wr

  1   2   >