Fredericksburg VA ZPUG: No December meeting; details on Jan and Feb meetings

2005-11-27 Thread Gary Poster
As discussed at the November Fredericksburg, VA ZPUG meeting, we are not going to have a December 14 ZPUG because of holiday goings-on. Andrew Sawyers will present on Squid and Zope in our January 11 meeting (other topics TBD). Zac Bir, Benji York, and Gary Poster will present in our

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

2005-11-27 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'Aprano

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

2005-11-27 Thread Christoph Zwerschke
Martin v. Löwis schrieb: As Mike has written in his last posting, you could easily fix that by tweaking the equality relation as well. So technically speaking, Mike is probably right. No. If you define both __hash__ and __eq__ consistently, then __hash__ would meet the specification. As

Re: How can I do this in Python?

2005-11-27 Thread Jonathan Gardner
I don't know what engine you are using. Basically all you have to do is render the login form at the url of the page that needs the login. You're going to have to hook in the authentication code before you render the page normally. For instance, this is a common way I've been doing it in various

Re: Syntax

2005-11-27 Thread Fredrik Lundh
Terry Hancock wrote: I don't think there are any *security* reasons, but stylistically, import os is greatly preferred. When someone else reads your code, they will immediately know where getcwd() comes from. It's not a question of security in the usual sense, but the first syntax

Re: interactive prompts

2005-11-27 Thread Ben Finney
Michael Williams [EMAIL PROTECTED] wrote: how do I force the environmental variables set by one 'popen' or 'pexpect' to propagate throughout the entire Python session so that any commands called will see those env variables? A process's environment must be inherited from its parent, or set

Re: wxPython Licence vs GPL

2005-11-27 Thread Steven D'Aprano
On Sat, 26 Nov 2005 09:54:24 -0800, Alex Martelli wrote: My understanding is that both Oracle and SAP make most of their money through consulting and customization rather than licencing or sales. I Have you checked their quarterly statements recently? Obviously not. Thanks for going

Re: wxPython Licence vs GPL

2005-11-27 Thread Rikard Bosnjakovic
Steven D'Aprano wrote: (Kids! Pirating software is stealing!!!) Or evaluating, depending of how you look at it. -- Sincerely, |http://bos.hack.org/cv/ Rikard Bosnjakovic | Code chef - will cook for food

Re: Comparison problem

2005-11-27 Thread Fredrik Lundh
Peter Hansen wrote: Actually, it's not so much baroque as it is safe... item[0] will fail if the string is empty, while item[0:1] will return '' in that case. Of course, as you point out, .startswith() is the better approach anyway. $ timeit -s s = 'abc' s[:1] == 'a' 100 loops, best of

Re: Why are there no ordered dictionaries?

2005-11-27 Thread Christoph Zwerschke
Bengt Richter wrote: d.keys[:] = newkeyseq Do you really mean just re-ordering the keys without a corresponding reording of values?? That would be a weird renaming of all values. Or do you means that any key should still retrieve the same value as before if used as d[key]? In which case

Re: Why are there no ordered dictionaries?

2005-11-27 Thread Christoph Zwerschke
Christoph Zwerschke wrote: I will assume that d has is a Foord/Larosa ordered dict with sequence attribute in the following. Then, with other words, d.keys[:] = newkeyseq should do the same as: d.sequence = newkeyseq At least in the case where newkeyseq is a permutation of

Re: wxPython Licence vs GPL

2005-11-27 Thread Steven D'Aprano
On Sat, 26 Nov 2005 21:39:13 +0100, Martin P. Hellwig wrote: The software was sold in 3 separates modules requiring a yearly renewal, The software is hardly sold if you have to renew that sale every year. That's more like a lease. I'd call it revenue from licencing, not revenue from sales. Of

Re: Comparison problem

2005-11-27 Thread [EMAIL PROTECTED]
I think no matter what language you programs it, it is hard to understand. Can you break it up into sub-problems first ? Like first parsing the inventory file into a python dict, then also the fields from web to another dict ? Chris wrote: Hi, I'm new to python, and I'm trying to write a small

Re: Why are there no ordered dictionaries?

2005-11-27 Thread Fuzzyman
Note that I've done two things with the Foord/Larosa dict. ;-) I've implemented slicing, including slice assignment and deletion. I've also 'hidden' ``sequence``, but you can pass arguments to keys, values and items. I've done a second (experimental) implementation of a custom keys object. This

Re: Which License Should I Use?

2005-11-27 Thread mojosam
First thing first, you need to find out if you are an employee, not in the normal sense, but legal sense. You're right. I know there has been a lot of case law to come down the pike over the years, due to all sorts of issues. One of my friends is a cab driver. His contract says that he is an

Re: Why are there no ordered dictionaries?

2005-11-27 Thread Christoph Zwerschke
Bengt Richter schrieb: OTOH, {}[:] Traceback (most recent call last): File stdin, line 1, in ? TypeError: unhashable type I.e., slices are not valid keys for ordinary dicts, and slices tie in very well with the ordered aspect of ordered dicts, so that's an argument for permitting

Re: How to get started in GUI Programming?

2005-11-27 Thread Claudio Grondi
[EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] 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

Re: The imp module and cyclic imports

2005-11-27 Thread Matthias Kramm
the problem you're seeing appears also if you use import web.one or from web import one or __import__('web.one'). Thanks for the hint. You're right. This isn't actually imp related. The standard import also fails. if you replace the from web import statements with plain imports, everything

Re: Which License Should I Use?

2005-11-27 Thread [EMAIL PROTECTED]
Yup, these independent contractor test doctrines bite both way and in your case, it is not in your advantage, usually. I would suggest that whatever tools you want to make to enhance the work(even it is inspired by your current task), don't use it on this employer/client, at least not on their

pyext - google

2005-11-27 Thread tim
Hi, I'm playing around with the python external for PureData. (pyext) I want to enable a patch to lookup something on the net. I modified the search.py example from Dive Into Python and kind of pasted it into the simple.py example from the pyext docs to be loaded in a pd patch. Loading the

Has this problem been fiexed ?

2005-11-27 Thread Xiao Jianfeng
Hello, I'm trying to build python2.4.2 on IRIX6.5(cc version MIPSpro Compilers: Version 7.3.1.3m). But the socket module failed to compile. I found this in ./Modules/socketmodule.c, line 193: /* XXX Using _SGIAPI is the wrong thing, 194

Estimating memory use?

2005-11-27 Thread Roy Smith
I've got a large text processing task to attack (it's actually a genomics task; matching DNA probes against bacterial genomes). I've got roughly 200,000 probes, each of which is a 25 character long text string. My first thought is to compile these into 200,000 regexes, but before I launch

Re: How to get started in GUI Programming?

2005-11-27 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: I am trying to learn GUI programming in Python, but have to confess I am finding it difficult. Don't do it if you can prevent it. GUI - toolkits are very complex beasts and at least to me a source of pain far more as a joy. Python cannot help you making them

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

2005-11-27 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'Aprano

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

2005-11-27 Thread Martin v. Löwis
Christoph Zwerschke wrote: Anyway, the original question was: Are mylist1 and mylist2 (as above) to be considered hashable types or not? I long forgot was the original question was (I thought it was Why is dictionary.keys() a list and not a set? :-); anyway, the answer to this question is

Tablelist-tcl-tk-tile

2005-11-27 Thread malv
Wanting to explore tk under python, I must say that it seems to be very difficult to find the required information in one single place. I would like to give tk a try but as I need as a test something equivalent of the Qt datagrid, I don't seem manage yet to get the latest releases of tablelist,

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

2005-11-27 Thread Christoph Zwerschke
Martin v. Löwis wrote: I long forgot was the original question was (I thought it was Why is dictionary.keys() a list and not a set? :-) Er, yes. Probably we should have opened a new thread instead: Improvement of the std lib doc concerning keys of sets/dicts. -- Christoph --

Cross-Platform Readkey (one more try...)

2005-11-27 Thread Dustan
I've posted this before, but not gotten an answer: I found this site that has code that does readkey for Windows, Unix, and in an updated version, Mac: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892 The Mac readkey class returns a character whether or not a key was pressed. I

Re: Tablelist-tcl-tk-tile

2005-11-27 Thread Kevin Walzer
malv wrote: Wanting to explore tk under python, I must say that it seems to be very difficult to find the required information in one single place. I would like to give tk a try but as I need as a test something equivalent of the Qt datagrid, I don't seem manage yet to get the latest releases

Re: wxPython Licence vs GPL

2005-11-27 Thread Martin P. Hellwig
Steven D'Aprano wrote: On Sat, 26 Nov 2005 21:39:13 +0100, Martin P. Hellwig wrote: The software was sold in 3 separates modules requiring a yearly renewal, The software is hardly sold if you have to renew that sale every year. That's more like a lease. I'd call it revenue from licencing,

passing artibrary strings into a database

2005-11-27 Thread schwehr
Hi All, I was wondering if there is a helper library out there that will nicely encode artibrary text so that I can put in into a TEXT field in a database and then retrieve it without getting into trouble with ',,new lines or other such things that would foul the sql insert call and or be a

Re: passing artibrary strings into a database

2005-11-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I was wondering if there is a helper library out there that will nicely encode artibrary text so that I can put in into a TEXT field in a database and then retrieve it without getting into trouble with ',,new lines or other such things that would foul the sql insert

Re: passing artibrary strings into a database

2005-11-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Hi All, I was wondering if there is a helper library out there that will nicely encode artibrary text so that I can put in into a TEXT field in a database and then retrieve it without getting into trouble with ',,new lines or other such things that would foul the

Re: Estimating memory use?

2005-11-27 Thread Tim N. van der Leeuw
Hi, What is your 'static' data (database), and what is your input-data? Those 200.000 probes are your database? Perhaps they can be stored as pickled compiled regexes and thus be loaded in pickled form; then you don't need to keep them all in memory at once -- if you fear that memory usage will

Re: passing artibrary strings into a database

2005-11-27 Thread schwehr
Thanks! Looks like I need to get a newer version of pysqlite into the fink package tree since pysqlite 1.0.1 does not appear support that -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython Licence vs GPL

2005-11-27 Thread Paul Boddie
Fredrik Lundh wrote: 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

Fractal curve

2005-11-27 Thread Steve Heyburn
Hello there, I am studying programming at University and we are basing the course on Python. We are currently looking at fractal curves and I was wondering if you could email me code for a dragon curve please, or a similar fractal curve. Thank you Steve --

nesting for statements?

2005-11-27 Thread tpcolson
I'm not what you'd call a programmer of any sort, so perhaps this question may seem arcane and result in a plethora of you idiot threads, but here goes: ArcGIS 9.1 has a neat interface with python (2.1-2.4), allowing me to do all sorts of spatial operations within python, namely, repetitive

Re: wxPython Licence vs GPL

2005-11-27 Thread Alex Martelli
Steven D'Aprano [EMAIL PROTECTED] wrote: ... Thanks for going beyond the call of duty to research the facts in such You're welcome! Like most amateur investors, I kid myself that research makes my stock picks better (considering the tiny amounts one actually invests, I doubt that any dollar

Re: Estimating memory use?

2005-11-27 Thread Alex Martelli
Roy Smith [EMAIL PROTECTED] wrote: ... Is there any easy way to find out how much memory a Python object takes? No, but there are a few early attempts out there at supplying SOME ways (not necessarily easy, but SOME). For example, PySizer, at http://pysizer.8325.org/. Alex --

Re: best cumulative sum

2005-11-27 Thread David Isaac
Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think that the test for an empty iterator makes ireduce() unintuitive. OK. I misunderstood you point. But that is needed to match the behavior of reduce. reduce(operator.add,[],42) 42 Thanks, Alan --

Re: Estimating memory use?

2005-11-27 Thread Roy Smith
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Alex Martelli) wrote: Roy Smith [EMAIL PROTECTED] wrote: ... Is there any easy way to find out how much memory a Python object takes? No, but there are a few early attempts out there at supplying SOME ways (not necessarily easy, but

Re: Which License Should I Use?

2005-11-27 Thread Andrew Koenig
mojosam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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

Re: Which license should I use?

2005-11-27 Thread Andrew Koenig
Björn Lindström [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Mike Meyer [EMAIL PROTECTED] writes: If they have the rights to the code, they can sell it, under the GPL or any license of their choosing. In addition, if you GPL it, your employer will be able to sell it, just like

Re: Which License Should I Use?

2005-11-27 Thread Andrew Koenig
mojosam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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

Re: best cumulative sum

2005-11-27 Thread Peter Otten
David Isaac wrote: Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think that the test for an empty iterator makes ireduce() unintuitive. OK. I misunderstood you point. But that is needed to match the behavior of reduce. reduce(operator.add,[],42) 42 Wouldn't an

Re: Which License Should I Use?

2005-11-27 Thread Robert Kern
Andrew Koenig wrote: Robert Kern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You're in something of a gray area, but one that has seen a lot of litigation. Although you are technically a consultant, you are probably considered an employee with regards to the work made for hire

Re: Which License Should I Use?

2005-11-27 Thread Andrew Koenig
Robert Kern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You're in something of a gray area, but one that has seen a lot of litigation. Although you are technically a consultant, you are probably considered an employee with regards to the work made for hire doctrine. You should

Re: Which License Should I Use?

2005-11-27 Thread Robert Kern
Andrew Koenig wrote: Yup. If you're not an employee (that is, if you get a 1099 form rather than a W-2 form from your client), then any work you do belongs to you *except* for what you agree in writing belongs to them. So if you write code that's not part of any deliverable, it's yours.

Re: Estimating memory use?

2005-11-27 Thread Fredrik Lundh
Roy Smith wrote: I've already discovered one (very) surprising thing -- if I build a dict containing all my regexes (takes about 3 minutes on my PowerBook) and pickle them to a file, re-loading the pickle takes just about as long as compiling them did in the first place. the internal RE byte

Basic about Python class

2005-11-27 Thread Manuel11g
Hello, I am a new programmer in Python and a need some help. Where can i get a basic tutorial about Class. I don't know nothing about Object Oriented Programming. Can you help me? -- http://mail.python.org/mailman/listinfo/python-list

Re: Fractal curve

2005-11-27 Thread Steve Holden
Steve Heyburn wrote: Hello there, I am studying programming at University and we are basing the course on Python. We are currently looking at fractal curves and I was wondering if you could email me code for a dragon curve please, or a similar fractal curve.

How to enable bash mode at the interative mode?

2005-11-27 Thread Anthony Liu
That is, at the Python interactive mode, if I hit the upper arrow key, it'll bring up the last line of code. At http://groups.google.com/group/comp.lang.python/browse_thread/thread/fb8c2fd9eed0d/736fac8c33e84d0c?lnk=stq=python+%22upper+arrow%22rnum=2hl=en#736fac8c33e84d0c , it seems that Michael

Re: nesting for statements?

2005-11-27 Thread Paul Watson
[EMAIL PROTECTED] wrote: I'm not what you'd call a programmer of any sort, so perhaps this question may seem arcane and result in a plethora of you idiot threads, but here goes: ArcGIS 9.1 has a neat interface with python (2.1-2.4), allowing me to do all sorts of spatial operations within

Re: Basic about Python class

2005-11-27 Thread Brett Hoerner
Manuel11g wrote: Hello, I am a new programmer in Python and a need some help. Where can i get a basic tutorial about Class. I don't know nothing about Object Oriented Programming. Can you help me? http://diveintopython.org/object_oriented_framework/index.html --

Re: Estimating memory use?

2005-11-27 Thread MrJean1
There is a function mx_sizeof() in the mx.Tools module from eGenix which may be helpful. More at http://www.egenix.com/files/python/eGenix-mx-Extensions.html#mxTools /Jean Brouwers PS) This is an approximation for memory usage which is useful in certain, simple cases. Each built-in type has

XMLSchema Parsing

2005-11-27 Thread km
Hi all, i'd like to know if there are any good XMLSchema (.xsd files) parsing modules in python. regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: Estimating memory use?

2005-11-27 Thread MrJean1
The name of the function in mx.Tools is sizeof() and not mx_sizeof(). My apologies. Also, it turns out that the return value of mx.Tools.sizeof() function is non-aligned. For example mx.Tools.sizeof(abcde) returns 29 which is fine, but not entirely accurate. /Jean Brouwers --

Re: ownership problem?

2005-11-27 Thread Gabriel Zachmann
the problem isn't determining who owns it, the problem is determining who's supposed to release it. that's not a very common problem in a that's about what i meant. i think, in c++, the ownership problem means the problem to determine who and when is to delete an object, or to keep track

Re: How to enable bash mode at the interative mode?

2005-11-27 Thread Piet van Oostrum
Anthony Liu [EMAIL PROTECTED] (AL) escribió: AL That is, at the Python interactive mode, if I hit the AL upper arrow key, it'll bring up the last line of code. AL At AL

Re: Which License Should I Use?

2005-11-27 Thread Mike Meyer
Andrew Koenig [EMAIL PROTECTED] writes: I'm pretty sure that there was a change to the copyright laws a few years ago (perhaps as part of the DMCA), that made it clear that you own everything you produce, unless you're a W-2 employee or there is a written agreement to the contrary.

Re: New docs for set elements/dictionary keys

2005-11-27 Thread Mike Meyer
Martin v. Löwis [EMAIL PROTECTED] writes: 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

Re: New docs for set elements/dictionary keys

2005-11-27 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 with the

RE: Python as Guido Intended

2005-11-27 Thread Delaney, Timothy (Tim)
Bryan wrote: i agree with you... pyrex should be part of the python distribution :) And this has been discussed on python-dev. Greg has stated though that he doesn't feel it's ready (there are other factors, but this one is overriding). There were also discussions about the fact that to get

Re: Profiling with hotshot and wall clock time

2005-11-27 Thread Carl Friedrich Bolz
Hi! Geert Jansen wrote: I'm trying to profile an application that I believe is blocking on I/O for a significant amount of time. In trying to dig down where this happens, I profiled the application with hotshot. The results are not really usable however as it seems to display the amount of

exception KeyboardInterrupt and os.system command

2005-11-27 Thread darren kirby
Hello all. I have a python script here which is just a wrapper for 2 or more system commands. I would estimate the program spends at least 95.5% of 'real' time running the system commands. I want to trap the [crtl-c] key combo and exit (somewhat) gracefully if the user decides to abort the

Re: exception KeyboardInterrupt and os.system command

2005-11-27 Thread Diez B. Roggisch
darren kirby wrote: Hello all. I have a python script here which is just a wrapper for 2 or more system commands. I would estimate the program spends at least 95.5% of 'real' time running the system commands. I want to trap the [crtl-c] key combo and exit (somewhat) gracefully if the

Re: exception KeyboardInterrupt and os.system command

2005-11-27 Thread jepler
You can tell by the exit code from system() whether the subprocess exited due to a signal. Consider this code: import os while 1: print os.system(sleep 1) unless you happen to hit ctrl-c at the right time, you'll see it print 2 (and 0 when the sleep finishes). The exit code can

Re: How to enable bash mode at the interative mode?

2005-11-27 Thread Carl Friedrich Bolz
Anthony Liu wrote: That is, at the Python interactive mode, if I hit the upper arrow key, it'll bring up the last line of code. At http://groups.google.com/group/comp.lang.python/browse_thread/thread/fb8c2fd9eed0d/736fac8c33e84d0c?lnk=stq=python+%22upper+arrow%22rnum=2hl=en#736fac8c33e84d0c

importing a method

2005-11-27 Thread Flavio
hi, I have an object defined with a number of hardcoded methods. Class soandso: def __init__(self): self.this = 0 self.that = 1 def meth1(self): ... def meth2(self): ... def custom(self): pass I want to allow the user to write a python

Re: Writing pins to the RS232

2005-11-27 Thread [EMAIL PROTECTED]
First of all I'd like to thank all of you for your input. It's nice to have a place to throw ideas around and get some feedback. I think the reason the serial source code I'm using is using javax.comm stuff which is possibly part of Jython is because I'm on Mac OS X. However this is just my

Re: Syntax

2005-11-27 Thread Peter Hansen
Terry Hancock wrote: [EMAIL PROTECTED] wrote: One of these two ways you're not supposed to use for security reasons, but I'm spacing on which one. It's not a question of security in the usual sense, but the first syntax imports a lot of stuff into the current namespace, increasing the risk of

Re: Comparison problem

2005-11-27 Thread Peter Hansen
Fredrik Lundh wrote: Peter Hansen wrote: Actually, it's not so much baroque as it is safe... item[0] will fail if the string is empty, while item[0:1] will return '' in that case. Of course, as you point out, .startswith() is the better approach anyway. $ timeit -s s = 'abc' s[:1] == 'a'

SCU3 and Python packaged for U3 (with SCU3) V 0.1 released

2005-11-27 Thread Philippe C. Martin
Dear all, I am very happy to announce the release of SCU3 V 0.1 and SCU3Python.u3p V. 0.1. SCU3 is a python wrapper for U3 compliante devices SCU3Python.u3p is a Python binary (2.4.2) packaged with SCU3 that allows to launch idle from the U3 device launchpad Both may be found on

Re: Writing pins to the RS232

2005-11-27 Thread Roy Smith
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: While I realize this is more on a driver/hardware level it's interesting that it's so difficult to use a different protocol for an existing driver. For example, all serial does is a series of high and low voltages on specific pins. Why should it be

Re: exception KeyboardInterrupt and os.system command

2005-11-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: You can tell by the exit code from system() whether the subprocess exited due to a signal. Consider this code: import os while 1: print os.system(sleep 1) unless you happen to hit ctrl-c at the right time, you'll see it print 2 (and 0 when the sleep

Re: Estimating memory use?

2005-11-27 Thread François Pinard
[Fredrik Lundh] the internal RE byte code format is version dependent, so pickle stores the patterns instead. Oh! Nice to know. That explains why, when I was learning Python, my initial experiment with pickles left me with the (probably wrong) feeling that they were not worth the trouble.

Re: Writing pins to the RS232

2005-11-27 Thread [EMAIL PROTECTED]
ahhh I understand now -- http://mail.python.org/mailman/listinfo/python-list

Re: How to enable bash mode at the interative mode?

2005-11-27 Thread Anthony Liu
Hi, thanks. Look what I have: $ python Python 2.4.2 (#1, Nov 20 2005, 13:03:38) [GCC 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)] on linux2 Yes, I realize that I don't have readline module available. The same Mandrake system has Python 2.3 as well, and it has the readline module. I don't know how

Re: importing a method

2005-11-27 Thread Ben Finney
Flavio [EMAIL PROTECTED] wrote: Class soandso: def __init__(self): self.this = 0 self.that = 1 def meth1(self): ... def meth2(self): ... def custom(self): pass I want to allow the user to write a python module that declares a

Re: importing a method

2005-11-27 Thread Chris Curvey
why not just have your user subclass soandso and override the definition of custom? from soandso import soandso class MyClass(soandso): def custom(self): self.theother = 3 c = MyClass() -- http://mail.python.org/mailman/listinfo/python-list

Re: best cumulative sum

2005-11-27 Thread [EMAIL PROTECTED]
Peter Otten wrote: David Isaac wrote: Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think that the test for an empty iterator makes ireduce() unintuitive. OK. I misunderstood you point. But that is needed to match the behavior of reduce.

General question about Python design goals

2005-11-27 Thread Christoph Zwerschke
Sometimes I find myself stumbling over Python issues which have to do with what I perceive as a lack of orthogonality. For instance, I just wanted to use the index() method on a tuple which does not work. It only works on lists and strings, for no obvious reason. Why not on all sequence types?

Re: General question about Python design goals

2005-11-27 Thread Robert Kern
Christoph Zwerschke wrote: Sometimes I find myself stumbling over Python issues which have to do with what I perceive as a lack of orthogonality. For instance, I just wanted to use the index() method on a tuple which does not work. It only works on lists and strings, for no obvious

Re: General question about Python design goals

2005-11-27 Thread Paul Rubin
Robert Kern [EMAIL PROTECTED] writes: Yes. If it's not going to be used, then there's not much point. Practicality beats purity, and all that. Geez man, practicality beats purity only means that if maintaining purity of something is impractical, you can judiciously let purity slide. It doesn't

PYTHONDOCS on OSX

2005-11-27 Thread Robert Hicks
How do I set this variable in my .bash_profile? I have the html docs in /usr/local/PythonDocs. Thanks for any help... Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: New docs for set elements/dictionary keys

2005-11-27 Thread Mike Meyer
Martin v. Löwis [EMAIL PROTECTED] writes: Me, personally, I had your definition in mind: hashable should indicate returns a value constant over time and consistent with comparison. I suggested that most people would consider hashable to mean: hash() returns a value. To those people, it is a

Re: General question about Python design goals

2005-11-27 Thread Robert Kern
Paul Rubin wrote: Robert Kern [EMAIL PROTECTED] writes: Yes. If it's not going to be used, then there's not much point. Practicality beats purity, and all that. Geez man, practicality beats purity only means that if maintaining purity of something is impractical, you can judiciously let

Re: General question about Python design goals

2005-11-27 Thread Aahz
In article [EMAIL PROTECTED], Christoph Zwerschke [EMAIL PROTECTED] wrote: For instance, I just wanted to use the index() method on a tuple which does not work. It only works on lists and strings, for no obvious reason. Why not on all sequence types? Because Guido believes that tuples should

Re: General question about Python design goals

2005-11-27 Thread Christoph Zwerschke
Let me ask back: Do I really need to bother and justify it with a use case in a case where the language can be easily made more consistent or orthogonal without breaking anything? Robert Kern wrote: Yes. If it's not going to be used, then there's not much point. Practicality beats purity,

Re: General question about Python design goals

2005-11-27 Thread Robert Kern
Christoph Zwerschke wrote: Let me ask back: Do I really need to bother and justify it with a use case in a case where the language can be easily made more consistent or orthogonal without breaking anything? Robert Kern wrote: Yes. If it's not going to be used, then there's not much point.

Re: General question about Python design goals

2005-11-27 Thread Christoph Zwerschke
For instance, I just wanted to use the index() method on a tuple which does not work. ... Aahz wrote: Because Guido believes that tuples should be primarily used as lightweight replacements for C structs. Therefore they have minimal functionality. But the problem is that the tutorials and

How to make tkFileDialog GUI larger?

2005-11-27 Thread John Wheez
Hi all, I'm using teh tkFileDialog to let teh user select a directory. We have long names which make it difficult to view the directories. For some reason the GUI windows doesn;t expand on Windows like it does on OS X or Linux. Is there a method to make the widths of the tkFileDialog windows

Re: General question about Python design goals

2005-11-27 Thread Peter Hansen
Christoph Zwerschke wrote: But it just led me to the general question: Which significance actually have design features such as orthogonality for Python? Probably very little. Python has not so much been designed as evolved. Plus it's a fairly mature language (over 14 years old), and I

Re: General question about Python design goals

2005-11-27 Thread [EMAIL PROTECTED]
Christoph Zwerschke wrote: For instance, I just wanted to use the index() method on a tuple which does not work. ... Aahz wrote: Because Guido believes that tuples should be primarily used as lightweight replacements for C structs. Therefore they have minimal functionality. But the

Re: New docs for set elements/dictionary keys

2005-11-27 Thread Christoph Zwerschke
Mike Meyer wrote: Any object for which hash() returns an appropriate value(1) can be used as a dictionary key/set element. Lists, sets and dicts are not hashable, and can not be used. Tuples can be used if all the things they contain are hashable. instances of all other builin types can be

Re: reading internet data to generate random numbers.

2005-11-27 Thread Levi Campbell
thank you, that was what I needed. -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-11-27 Thread Paul Rubin
Robert Kern [EMAIL PROTECTED] writes: Fine. Allow me to rephrase. Development is primarily motivated by practical needs and guided by notions of purity. That's bogus; if there was a discrepancy someone noticed and had to work around, there's already been a practical failure, just not a severe

Re: General question about Python design goals

2005-11-27 Thread Jean-Paul Calderone
On 27 Nov 2005 19:49:26 -0800, Paul Rubin http://phr.cx@nospam.invalid wrote: Robert Kern [EMAIL PROTECTED] writes: Use cases are the primary tool for communicating those practical needs. If you can't think of a single use case, what's the point of implementing something? Or rather, why should

should python have a sort list-map object in the std-lib?

2005-11-27 Thread Tim Henderson
Hi The question why are there no sorted dictionaries in python, seems to pop up with unseeming regularity. That question in itself in nonsensical sense dictionaries are hash-maps, however should python have a sorted map type object is a good question. clearly many people like have a sorted map,

  1   2   >