Re: wxPython Licence vs GPL

2005-11-25 Thread Mike Meyer
"Paul Boddie" <[EMAIL PROTECTED]> writes: > Ed Jensen wrote: > [On proprietary ports of Python...] >> Show me the harm done. > We'll have to wait and see what happens. There's a risk that versions > of Python with different semantics or characteristics to the original > could cause the development

python and pymat

2005-11-25 Thread Knut Birger Lunde
Pretty new to python I have a module for python who is made for python2.2. I have the endthought version 2.3. I have dowloaded a c++ source file and a makefile to create pymat.dll. However I think the maekfile is made for cygwin, since it complains that it does not find -lpython23 . This

Re: Persist a class (not an instance)

2005-11-25 Thread David Wahler
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. I couldn't resist the challenge

Re: Which License Should I Use?

2005-11-25 Thread Mike Meyer
"mojosam" <[EMAIL PROTECTED]> writes: > I will be doing the bulk of the coding on my own time, because I need > to be able to take these tools with me when I change employers. > However, I'm sure that in the course of using these tools, I will need > to spend time on the job debugging or tweaking t

Re: Why are there no ordered dictionaries?

2005-11-25 Thread Tom Anderson
On Wed, 23 Nov 2005, Christoph Zwerschke wrote: > Tom Anderson wrote: > >>> I think it would be probably the best to hide the keys list from the >>> public, but to provide list methods for reordering them (sorting, slicing >>> etc.). >> >> one with unusual constraints, so there should be a list

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

2005-11-25 Thread Christoph Zwerschke
Mike Meyer schrieb: > 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). I would be even more simple he

Re: Which License Should I Use?

2005-11-25 Thread Robert Kern
mojosam wrote: > I will be doing the bulk of the coding on my own time, because I need > to be able to take these tools with me when I change employers. > However, I'm sure that in the course of using these tools, I will need > to spend time on the job debugging or tweaking them. I do not want my

Move xml.sax.saxutils.*?

2005-11-25 Thread [EMAIL PROTECTED]
It seems like functions such as xml.sax.saxutils.escape and unescape are generally useful, and not at all tied to the xml.sax module. Would it make sense to move them somewhere else, like to xml? I ask because it just took me 20 minutes to figure out how to escape entities in python. It's not ob

Re: Why are there no ordered dictionaries?

2005-11-25 Thread Christoph Zwerschke
Tom Anderson schrieb: > Maybe we should call it a 'sequenced dictionary' to fit better with > pythonic terminology? That's not such a bad idea. Note that it is called like that in the Python version of the "Programming Language Examples Alike Cookbook": http://pleac.sourceforge.net/pleac_pytho

Re: Which license should I use?

2005-11-25 Thread Björn Lindström
Mike Meyer <[EMAIL PROTECTED]> writes: > IANAL, but I don't believe the GPL helps in this situation. It places > conditions on redistributing the code; it doesn't force you to > redistribute modifieed code. Your employers could refuse to let you > take the code with you because they own partial co

Re: Why are there no ordered dictionaries?

2005-11-25 Thread Christoph Zwerschke
It seems everybody is in full agreement here. I have the same mixed feeling about letting keys/values/items become both managed list attributes and still returning copies of the lists when called in the usual way as methods. I don't know any precedent for doing things that way and i'm unsure w

CGI question

2005-11-25 Thread Dan Stromberg
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? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Which License Should I Use?

2005-11-25 Thread Paul Watson
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

Writing pins to the RS232

2005-11-25 Thread [EMAIL PROTECTED]
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 set however many pins as 0's or 1'

Re: How to get started in GUI Programming?

2005-11-25 Thread [EMAIL PROTECTED]
did you search GUI in this group? I think the results will be helpful. some other GUI packages you might of missed are wxPython and pygame -- http://mail.python.org/mailman/listinfo/python-list

Re: Which license should I use?

2005-11-25 Thread Mike Meyer
[EMAIL PROTECTED] (Björn Lindström) writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> IANAL, but I don't believe the GPL helps in this situation. It places >> conditions on redistributing the code; it doesn't force you to >> redistribute modifieed code. Your employers could refuse to let you >>

Re: Writing pins to the RS232

2005-11-25 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[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 BA

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

2005-11-25 Thread Mike Meyer
Christoph Zwerschke <[EMAIL PROTECTED]> writes: > Mike Meyer schrieb: >> 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

Re: How to get started in GUI Programming?

2005-11-25 Thread BartlebyScrivener
[EMAIL PROTECTED] wrote: > I am trying to learn GUI programming in Python, but have to confess I > am finding it difficult. > > I am not an experienced programmer - just someone who from time to > time writes small programs for my use. Over the years I have moved > from GWBASIC to QBASIC to Visua

Re: Why are there no ordered dictionaries?

2005-11-25 Thread Christoph Zwerschke
Tom Anderson wrote: > True, but that's not exactly rocket science. I think the rules governing > when your [] acts like a dict [] and when it acts like a list [] are > vastly more complex than the name of one attribute. I think it's not really rocket science either to assume that an ordered di

Re: wxPython Licence vs GPL

2005-11-25 Thread Paul Rubin
Ed Jensen <[EMAIL PROTECTED]> writes: > I think free software/open source has existed long enough and with > enough varied licenses (GPL, LGPL, modified LGPL (see wxWidgets), BSD, > X11, MIT, Apache, etc.) that we'd basically know without question if > less restritive licenses (like BSD) were causi

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

2005-11-25 Thread Christoph Zwerschke
Mike Meyer wrote: > The mutability - or immutability - of an object is irrelevant to > the question of whether or not they can be a dictionary key/set > element. The critical property is that they are hashable. > *Most* immutable builtin types are hashable, and no builtin > mutable types are

Re: How to get started in GUI Programming?

2005-11-25 Thread jmdeschamps
It all really depends on what you wish to achieve. Results are generally in proportion to the effort involved. I don't think a "Python for Nulls" exists ! the following thread deals with documentation for beginners (and others as well) http://groups.google.ca/group/comp.lang.python/browse_frm/threa

How to find the port a server is listening on (from within the server)

2005-11-25 Thread Tim Williams (gmail)
How can I find the port a server is listening on - at the commented line in the code below. (ie  self.serving_on_port_num =  ? ) I have googled a lot. :-( -- class BaseSrvr(SocketServer.ThreadingMixIn, SocketServer.TCPServer):  

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

2005-11-25 Thread Martin v. Löwis
Christoph Zwerschke wrote: > You need to know a third thing, namely that as an iterable object, a > dictionary returns the keys only, not the key/value tuples which would > also make some sense. If it had been designed that way, you could write Right. I forgot to say that, but that is also expla

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

2005-11-25 Thread Martin v. Löwis
Mike Meyer wrote: > I would have phrased it as "identical" instead of equal. Sets should > hold unique elements, where "unique" depends on the use at hand. For > some uses, "==" might be appropriate. For others, "is" might be > appropriate. Sets, as currently defined, require hashable objects, i.e

Re: Which License Should I Use?

2005-11-25 Thread Martin v. Löwis
mojosam wrote: > How do I decide on a license? If you want to look at this from a legal point of view, I highly recommend reading Larry Rosen's book, Open Source Licensing. It covers issue you would never have thought of without studying law, and gives good advice (IMHO). Regards, Martin -- htt

Re: Move xml.sax.saxutils.*?

2005-11-25 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > It seems like functions such as xml.sax.saxutils.escape and unescape > are generally useful, and not at all tied to the xml.sax module. Would > it make sense to move them somewhere else, like to xml? Moving it would be a bad idea. Exposing it elsewhere would be useful.

Re: Which License Should I Use?

2005-11-25 Thread Tom Anderson
On Fri, 25 Nov 2005, Robert Kern wrote: > You may also want to read this Licensing HOWTO: > > http://www.catb.org/~esr/faqs/Licensing-HOWTO.html > > It's a draft, but it contains useful information. It's worth mentioning that ESR, who wrote that, is zealously pro-BSD-style-license. That's not t

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

2005-11-25 Thread Mike Meyer
Christoph Zwerschke <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > > The mutability - or immutability - of an object is irrelevant to > > the question of whether or not they can be a dictionary key/set > > element. The critical property is that they are hashable. > > *Most* immutable builtin

Re: How to get started in GUI Programming?

2005-11-25 Thread gsteff
I learned pygtk via the tutorial and reference manual, and found most things to be pleasantly simple to do. A message dialog, for example, can be done via dialog = gtk.MessageDialog(buttons=gtk.BUTTONS_OK_CANCEL, message_format="Test message here.") response = dialog.run() All that can be found

vb2py question

2005-11-25 Thread sszmidt
Hi, Has anyone looked at or used vb2py lately? I'm looking at doing some conversion work and it's awfully out of date. Any other information on the subject would be welcome. -- Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing pins to the RS232

2005-11-25 Thread Peter Hansen
[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: How to find the port a server is listening on (from within the server)

2005-11-25 Thread jepler
If I understand correctly, you're looking for the socket method getsockname(), documented at http://docs.python.org/lib/socket-objects.html Jeff pgppauvaXgXhK.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Which License Should I Use?

2005-11-25 Thread Tom Anderson
On Fri, 25 Nov 2005, mojosam wrote: > How do I decide on a license? You decide on what obligations you wish to impose on licensees, then pick a license which embodies those. There are basically three levels of obligation: 1. None. 2. Derivatives of the code must be open source. 3. Derivative

Re: [Forged?] Re: How to find the port a server is listening on (from within the server)

2005-11-25 Thread Tim Williams (gmail)
On 26/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:    If I understand correctly, you're looking for the socket methodgetsockname(), documented at http://docs.python.org/lib/socket-objects.htmlJeff Many thanks Jeff, self.server.socket.getsockname() did the trick. -- -- http://mail.py

Re: Making immutable instances

2005-11-25 Thread Steven D'Aprano
On Thu, 24 Nov 2005 12:55:07 +, Antoon Pardon wrote: > Suppose I have the following code. > > from module import __take_care__ > > __private_detail__ = ... > > I now have two variable that are flaged the same way, but they are not. No, you have two names written using a poor naming convent

Re: How to get started in GUI Programming?

2005-11-25 Thread Luis M. Gonzalez
IMHO, the easier alternative for building GUI apps with Python is PythonCard. It is based on wxWindows, and it lets you build gui apps by dragging and dropping widgets on a form, just like VB or Delphi. It is very high level and very easy to learn and use. http://pythoncard.sourceforge.net/ Anoth

Re: wxPython Licence vs GPL

2005-11-25 Thread Steven D'Aprano
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 software), and perhaps a few console

Re: Making immutable instances

2005-11-25 Thread Steven D'Aprano
On Thu, 24 Nov 2005 11:44:16 -0500, Mike Meyer wrote: > In Python, I can even fix > it so *your* code uses my wrapped version: > > import Finney > class Addable(Finnney.Immutable): pass > Finney.Immutable = Addable > > Which means that from now on *your* code that tries to create > Immutables wi

Re: Unicode in MIMEText

2005-11-25 Thread Damjan
> ... 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 wrong? -- damjan -- h

Re: wxPython Licence vs GPL

2005-11-25 Thread Steven D'Aprano
On Thu, 24 Nov 2005 16:00:29 -0500, Mike Meyer wrote: > I believe in GPL'ed software - I use it regularly. On the other hand, > I don't believe that it represents the best license to release > software if the goal is to improve the lot of humanity. The > restrictions are on "distribution", not on

Any way to change files in a ZIP archive?

2005-11-25 Thread Damjan
I am looking for a way to change a file that is inside a zip archive, in python of course. The thing is, I'm doing a CGI script that accepts a zip file (an OpenOffice document), I need to make some transformations to one of the files in the ZIP archive, but not touch any of the other files in it,

Re: drawline

2005-11-25 Thread Ben Bush
On 11/23/05, Magnus Lycka <[EMAIL PROTECTED]> wrote: > Ben Bush wrote: > > I had the following code and when I clicked the left mouse button one > > time. I got green line and the second click got a purple line and the > > green disappeared. > > I was confused by two questions: > > It's good that t

Re: Making immutable instances

2005-11-25 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Thu, 24 Nov 2005 11:44:16 -0500, Mike Meyer wrote: >> In Python, I can even fix >> it so *your* code uses my wrapped version: >> >> import Finney >> class Addable(Finnney.Immutable): pass >> Finney.Immutable = Addable > > Python's consenting adults

Re: wxPython Licence vs GPL

2005-11-25 Thread Mike Meyer
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 people say things like: > If you don't like that clause, you ha

Re: wxPython Licence vs GPL

2005-11-25 Thread Steven D'Aprano
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, choose to show them your work wit

Re: the first element in the list of list

2005-11-25 Thread Ben Bush
On 11/22/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > "Ben Bush" wrote: > > > This question just came to my mind and not assigned by anyone. > > given that you and "Shi Mu" are asking identical questions, and that > you've both started to send questions via direct mail, can you please > ask your

Re: wxPython Licence vs GPL

2005-11-25 Thread Steven D'Aprano
On Fri, 25 Nov 2005 02:34:32 +, Ed Jensen wrote: > Because I think a lot of well meaning software developers writing free > software don't performance due diligence to determine the true > motivation behind, and the chilling effect of, the GPL. It took me seconds, seconds I say, to open a web

enum 0.3: Enumerations in Python

2005-11-25 Thread Ben Finney
Howdy all, I've uploaded enum 0.3 to the Cheeseshop. http://cheeseshop.python.org/pypi/enum/> Enumerations are now sequences, iterable (as before) *and* indexable:: >>> from enum import Enum >>> Weekdays = Enum('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat') >>> pizza_night = W

icmp - should this go in itertools?

2005-11-25 Thread Tom Anderson
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 excep

Re: icmp - should this go in itertools?

2005-11-25 Thread Roy Smith
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? Whatever happens, please name it somethin

Yet another ordered dictionary implementation

2005-11-25 Thread Tom Anderson
What up yalls, Since i've been giving it all that all over the ordered dictionary thread lately, i thought i should put my fingers where my mouth is and write one myself: http://urchin.earth.li/~twic/odict.py It's nothing fancy, but it does what i think is right. The big thing that i'm not ha

Mail Delivery System

2005-11-25 Thread seddharth
-- Virus Warning Message (on moms.localagri.com) Found virus WORM_MYTOB.V in file message.pif (in message.zip) The uncleanable file message.zip is moved to /etc/iscan/virus/virgp7pVn. - The message contains Unicode character

Re: Why are there no ordered dictionaries?

2005-11-25 Thread Tom Anderson
On Fri, 25 Nov 2005, Christoph Zwerschke wrote: > Tom Anderson wrote: > >> True, but that's not exactly rocket science. I think the rules governing >> when your [] acts like a dict [] and when it acts like a list [] are vastly >> more complex than the name of one attribute. > > I think it's not

Re: return in loop for ?

2005-11-25 Thread Steven D'Aprano
On Fri, 25 Nov 2005 08:36:48 +, Steve Holden wrote: That's not a problem if there exists a verification program A which can't verify itself but can verify program B, which in turn also can't verify itself but will verify program A. >>> >>>That is logically equivalent to the fi

Re: wxPython Licence vs GPL

2005-11-25 Thread Ed Jensen
Christophe <[EMAIL PROTECTED]> wrote: > If you don't like the GPL, then by all means, *do not use GPL code !* > > Please, I mean, when you use without authorisation some code in your > project, you are in trouble, no matter what licence the code was using. I'm not sure why you felt compelled to

Re: wxPython Licence vs GPL

2005-11-25 Thread Ed Jensen
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 development because of some legal wrangling in the early 90s t

Re: wxPython Licence vs GPL

2005-11-25 Thread Steven D'Aprano
On Fri, 25 Nov 2005 17:17:43 +, Ed Jensen wrote: > Whereas including > one line of GPL code into your 10,000,000,000 line project can have > disasterous consequences (which I find ridiculous) If you think that's disastrous, just try using one line of proprietary code in your 10,000,000,000 li

Re: Making immutable instances

2005-11-25 Thread Steven D'Aprano
On Fri, 25 Nov 2005 20:50:41 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> On Thu, 24 Nov 2005 11:44:16 -0500, Mike Meyer wrote: >>> In Python, I can even fix >>> it so *your* code uses my wrapped version: >>> >>> import Finney >>> class Addable(Finnney.Immutable): pas

Re: How to get started in GUI Programming?

2005-11-25 Thread Godwin Burby
Try http://boa-constructor.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: books: Dive into Python vs Beginning Python

2005-11-25 Thread Godwin Burby
I would recommend both, but as i have already bought the first version of Beginning Python known as Practical Python by Magnus. I can gaurantee you that the practical projects as well as the succinct python tutorial in the book will show you the full power and glory of Python. Magnus is a great aut

Re: wxPython Licence vs GPL

2005-11-25 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 24 Nov 2005 16:00:29 -0500, Mike Meyer wrote: > > > I believe in GPL'ed software - I use it regularly. On the other hand, > > I don't believe that it represents the best license to release > > software if the goal is to improve the lot of human

Re: wxPython Licence vs GPL

2005-11-25 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> 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 Expres

Re: Making immutable instances

2005-11-25 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > "Hmmm, the class designer didn't want me adding attributes to instances... > maybe he had a good reason for that..." When it was suggested that a facility for doing this be added to the language, I asked for a use case for it. Nobodies come up with a r

Re: Singleton and C extensions

2005-11-25 Thread Neal Norwitz
Emmanuel Briot wrote: > > I am not really good at python, but I was trying to implement the > singleton design pattern in C, so that for instance calling the constructor > >ed = Editor ("foo") > > would either return an existing instance of Editor currently editing > "foo", or would create a ne

Re: Writing big XML files where beginning depends on end.

2005-11-25 Thread Gerard Flanagan
Magnus Lycka wrote: > We're using DOM to create XML files that describes fairly > complex calculations. The XML is structured as a big tree, > where elements in the beginning have values that depend on > other values further down in the tree. Imagine something > like below, but much bigger and muc

Re: Any way to change files in a ZIP archive?

2005-11-25 Thread Do Re Mi chel La Si Do
Hi! See http://mclaveau.com/ress/python/zipmci.htm @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

<    1   2