Re: python-dev Summary for 2004-11-16 through 2004-11-30

2005-01-07 Thread Stelios Xanthakis
[EMAIL PROTECTED] wrote: Would you like the source with your function? Yes, since I asked for this feature something like two years ago ;-) Well, the main objection seemed to be that we can get the source of a function one way or another. For functions with a file (1) with "inspect" , for functio

Asyncore

2005-01-07 Thread export
Is there any tutorial and docs with samples how to use asyncore module? Thanks Lad -- http://mail.python.org/mailman/listinfo/python-list

Apple creator on Python

2005-01-07 Thread Marco Aschwanden
One of the "creators" of Apple has written a book and mentions Python in the interview: http://www.macdevcenter.com/pub/a/mac/2005/01/04/hertzfeld.html After writing around 20 stories, I shifted gears and worked on the web software to publish them, writing a simple authoring system in Python,

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Alan Gauld
On Thu, 06 Jan 2005 21:02:46 -0600, Doug Holton <[EMAIL PROTECTED]> wrote: > used, but there are people who do not like "lambda": > http://lambda-the-ultimate.org/node/view/419#comment-3069 > The word "lambda" is meaningless to most people. Of course so is "def", > which might be why Guido van Ro

Re: The Industry choice

2005-01-07 Thread Alex Martelli
Paul Rubin wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > Yes, apart from libraries and similar cases (frameworks etc), it's no > > doubt rare for closed-source "end-user packages" to be sold with > > licenses that include source and allow you to "do anything wit

Re: Excluded and other middles in licensing

2005-01-07 Thread Alex Martelli
Robert Kern <[EMAIL PROTECTED]> wrote: ... > >>While most people may not think of such programs as "closed source", > >>they most definitely ARE: the definition of open source is very strict > >>about this aspect. ... > > With my mathematical background, I'm consistent about calling > > these

Re: OT: spacing of code in Google Groups

2005-01-07 Thread Jacek Generowicz
Peter Hansen <[EMAIL PROTECTED]> writes: > Jacek Generowicz wrote: > > Peter Hansen <[EMAIL PROTECTED]> writes: > >>Why the heck would I ever have to do "rectangle operations" on a > >>regular basis? ;-) > > Well, given that all editors are cat equivalent[*], you don't _have_ > > to use any of th

Re: The Industry choice

2005-01-07 Thread Alex Martelli
Bulba! <[EMAIL PROTECTED]> wrote: > Suppose they want to ensure "no forking" or that "bugfixes > and enhancements of original software are given back". > > OK, LGPL is fine for this goal. When you say "they see it Neither LGPL nor GPL can ``ensure "no forking"'', nor can any other open-source l

Re: The Industry choice

2005-01-07 Thread Alex Martelli
Jeff Shannon <[EMAIL PROTECTED]> wrote: > Note that the so-called 'viral' nature of GPL code only applies to > *modifications you make* to the GPL software. The *only* way in which > your code can be 'infected' by the GPL is if you copy GPL source. ... > (Problems may come if someone licenses

Re: Excluded and other middles in licensing

2005-01-07 Thread Robert Kern
Alex Martelli wrote: Robert Kern <[EMAIL PROTECTED]> wrote: ... While most people may not think of such programs as "closed source", they most definitely ARE: the definition of open source is very strict about this aspect. ... With my mathematical background, I'm consistent about calling thes

Re: Python evolution: Unease

2005-01-07 Thread adamc
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2005-01-07, Paul Rubin wrote: > Roman Suzi <[EMAIL PROTECTED]> writes: >> I do not like the idea of having stubs. Once I had an experience working with >> CPAN (I tried to install SpamAssassin and it required some specific modules.) >> "Magic" inst

Re: Python evolution: Unease

2005-01-07 Thread Paul Rubin
adamc <[EMAIL PROTECTED]> writes: > I've not experienced problems installing wxPython on Debian (unstable). > It just *works* out of the box with apt-get. Perhaps this is more of a > problem with the package maintainers? I think the problem I encountered was that the version of WxWidgets currentl

Re: Excluded and other middles in licensing

2005-01-07 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > > http://en.wikipedia.org/wiki/Closed_source > > "any program whose licensing terms do not qualify as open source". > > A definition with a nice big "This article may need to be reworded to > conform to a neutral point of view" warning at the top. ;-) > ..

Re: python reading/writing ms-project files?

2005-01-07 Thread Simon Brunning
On 6 Jan 2005 16:05:07 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > any existing or pointers on how to do this? If you are running on Windows and have a copy of Project, then COM automation is probably your best bet. See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/279003 for a

Locale confusion

2005-01-07 Thread Jorgen Grahn
[Long posting due to the examples, but pretty simple question.] I'm sitting here with a Debian Linux 'Woody' system with the default Python 2.2 installation, and I want the re module to understand that re.compile(r'\W+'. re.LOCALE) doesn't match my national, accented characters. I don't quite und

Re: Pre/Postconditions with decorators

2005-01-07 Thread George Sakkis
"Robert Brewer" <[EMAIL PROTECTED]> wrote: > Ian Bicking was just talking about @require decorators: > http://blog.ianbicking.org/already-under-our-noses.html > > @require(int, int) > def gcd(a, b): > ... > > If we made a "checker" module for such things in the stdlib, we could > write most of

Tkinter Puzzler

2005-01-07 Thread Tim Daneliuk
I am trying to initialize a menu in the following manner: for entry in [("Up", KeyUpDir), ("Back", KeyBackDir), ("Home", KeyHomeDir), ("Startdir", KeyStartDir), ("Root", KeyRootDir)]: func = entry[1] UI.ShortBtn.menu.add_command(label=entry[0], command=lambda: func(None)) However, at runt

Re: Excluded and other middles in licensing

2005-01-07 Thread Alex Martelli
Paul Rubin wrote: > Note also from the Heine-Borel theorem that every closed source > program can be covered by some finite collection of open source > programs. Every _compact_ one, surely? Quoting by heart from old memories, but, isn't Heine-Borel about (being able r

Re: Pre/Postconditions with decorators

2005-01-07 Thread rittersporn
Hi Stephen I have not read anything about the "framehack lambda replacement" yet, but I do compile the pre- and postconditions. Syntax erros e.g. will be raised if the module is compiled. Although I must admit that your code snippets look more like compiled code ;-) Hi Robert thanks for the link t

missing sys.setappdefaultencoding

2005-01-07 Thread Uwe Mayer
Hi, well, I wrote a nice python program which won't work if the default encoding has not been set from ascii to latin-1 or latin-15. However, the command sys.setappdefaultencoding is missing on a Python installation with Python 2.3.4 on Gentoo where it is present on Debian. Any ideas how to deal

Re: The Industry choice

2005-01-07 Thread Robert Kern
Alex Martelli wrote: Until some judge passes some judgment, the intent and effect of GPL must remain a matter of opinion. But RMS's opinion is probably more meaningful than mine or yours -- certainly regarding intent, given his role in designing that license. But it may not have practical effect

Re: Python evolution: Unease

2005-01-07 Thread Alex Martelli
Paul Rubin wrote: > Really, I just want to buy a new > computer, turn it on, and have everything there. That's generally > impossible without running satanware from Redmond The princes of insufficient light from Cupertino will in fact be very happy to sell you such com

Re: Tkinter Puzzler

2005-01-07 Thread Eric Brunel
Tim Daneliuk wrote: I am trying to initialize a menu in the following manner: for entry in [("Up", KeyUpDir), ("Back", KeyBackDir), ("Home", KeyHomeDir), ("Startdir", KeyStartDir), ("Root", KeyRootDir)]: func = entry[1] UI.ShortBtn.menu.add_command(label=entry[0], command=lambda: func(No

Re: Tkinter Puzzler

2005-01-07 Thread F. Petitjean
Le 07 Jan 2005 05:28:31 EST, Tim Daneliuk a écrit : > I am trying to initialize a menu in the following manner: > > for entry in [("Up", KeyUpDir), ("Back", KeyBackDir), ("Home", KeyHomeDir), > ("Startdir", KeyStartDir), ("Root", > KeyRootDir)]: > > func = entry[1] > UI.ShortBtn.menu.

Re: Python evolution: Unease

2005-01-07 Thread Alex Martelli
Terry Reedy <[EMAIL PROTECTED]> wrote: ... > Even though I currently only have 80 megs (about the minimum one can You probably mean 80 gigs. You can get smaller disks, say 30 gigs, in entry-point laptops. But for a few dozen megs I think you'd have to go for solid-state "disks", say USB keys

Re: missing sys.setappdefaultencoding

2005-01-07 Thread Alex Martelli
Uwe Mayer <[EMAIL PROTECTED]> wrote: > Hi, > > well, I wrote a nice python program which won't work if the default encoding > has not been set from ascii to latin-1 or latin-15. Then your program is not very nice...;-) > However, the command sys.setappdefaultencoding is missing on a Python > in

_Re Pre/Postconditions with decorators

2005-01-07 Thread Rittersporn
# Google-News won't let be post a follow-up right now! # Google-Beta-News destroys the formatting :-( # So I'll start a new thread. Hi Stephen I have not read anything about the "framehack lambda replacement" yet, but I do compile the pre- and postconditions. Syntax erros e.g. will be raised if th

Re: Tkinter Puzzler

2005-01-07 Thread Alex Martelli
Tim Daneliuk <[EMAIL PROTECTED]> wrote: > I am trying to initialize a menu in the following manner: > > for entry in [("Up", KeyUpDir), ("Back", KeyBackDir), ("Home", > KeyHomeDir), ("Startdir", KeyStartDir), ("Root", KeyRootDir)]: > > func = entry[1] > UI.ShortBtn.menu.add_command(lab

Re: Tkinter Puzzler

2005-01-07 Thread Tim Daneliuk
Tim Daneliuk wrote: I am trying to initialize a menu in the following manner: for entry in [("Up", KeyUpDir), ("Back", KeyBackDir), ("Home", KeyHomeDir), ("Startdir", KeyStartDir), ("Root", KeyRootDir)]: func = entry[1] UI.ShortBtn.menu.add_command(label=entry[0], command=lambda: func(No

Re: Excluded and other middles in licensing

2005-01-07 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > Note also from the Heine-Borel theorem that every closed source > > program can be covered by some finite collection of open source > > programs. > > Every _compact_ one, surely? Quoting by heart from old memories, but, > isn't Heine-Borel about (bein

Re: Other notes

2005-01-07 Thread Steve Holden
Andrew Dalke wrote: Bengt Richter: But it does look ahead to recognize += (i.e., it doesn't generate two successive also-legal tokens of '+' and '=') so it seems it should be a simple fix. But that works precisely because of the greedy nature of tokenization. Given "a+=2" the longest token it find

Re: Asyncore

2005-01-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: Is there any tutorial and docs with samples how to use asyncore module? Thanks Lad Well, here's a very simple web server from Chapter 7 of "Python Web Programming" which might help get you started. You can see a few more examples if you download the code from the book,

Re: Python C Object Comparison

2005-01-07 Thread Anand K Rayudu
Dear Craig, Thanks a lot for the suggestions. I am just considering to create a user defined data type to  wrap the C pointer. I can add compare method for that data type. So all my APIs returns the new data type rather than PythonC Object. But hoping that it is not lot of over head with res

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Anna
Okay, I tried to post this previously but ran into the new Google groups system which appears to have sent my original response into the ether... Oops. Trying again. Alan Gauld wrote: > On Thu, 30 Dec 2004 23:28:46 +1000, Nick Coghlan > <[EMAIL PROTECTED]> wrote: > > > GvR has commented that he wa

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Paul Rubin
"Anna" <[EMAIL PROTECTED]> writes: > Having taken some calculus (derivatives, limits, some integrals) but > never even heard of lambda calculus, to me, lambda means absolutely > NOTHING. Less than nothing. Lambda calculus is from mathematical logic, but more to the point "lambda" has been the term

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Steve Holden
Paul Rubin wrote: "Anna" <[EMAIL PROTECTED]> writes: Having taken some calculus (derivatives, limits, some integrals) but never even heard of lambda calculus, to me, lambda means absolutely NOTHING. Less than nothing. Lambda calculus is from mathematical logic, but more to the point "lambda" has b

embedded scripts debugging

2005-01-07 Thread Andrey Tatarinov
Hi all. I have custom resource editor and wish python to be scripting language in it. But I don't want to lose ability of debugging which I currently have implementing all logic in C++. So the question is: Is there suitable library for simple python gui debugger, or may be there are some other

Re: Python evolution: Unease

2005-01-07 Thread Bulba!
On 06 Jan 2005 18:46:00 -0800, Paul Rubin wrote: >"Terry Reedy" <[EMAIL PROTECTED]> writes: >> Would it be possible, at least for Windows, to write a Python script >> implementing a 'virtual distribution'? IE, download Python, install it, >> download next package, ins

Re: Python evolution: Unease

2005-01-07 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > Paul Rubin wrote: > > Really, I just want to buy a new > > computer, turn it on, and have everything there. That's generally > > impossible without running satanware from Redmond > > The princes of insufficient light from Cupe

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > Perhaps what we really need is a good Lisp subsystem for Python? I've thought the other way around, it would be nice to have a Python subsystem for Lisp. -- http://mail.python.org/mailman/listinfo/python-list

Re: get the IP address of a host

2005-01-07 Thread Jorge Luiz Godoy Filho
Kartic, Quarta 05 Janeiro 2005 14:08, wrote: > socket.gethostbyaddr(socket.gethostname()) > > will return a tuple containing fully qualified hostname, alternative > hostnames, ip addresses (>1 if multihomed). > > or > > socket.gethostbyname(socket.gethostname()) None of these work with compute

Re: The Industry choice

2005-01-07 Thread Paul Rubin
Bulba! <[EMAIL PROTECTED]> writes: > From the viewpoint of looking at availability of source code A, > it's completely irrelevant if those guys are fishmongers or > make derived work A' and redistribute only binary of A'. Not > a single line of publicly available source code appeared or > disapp

Re: Python evolution: Unease

2005-01-07 Thread Bulba!
On Thu, 6 Jan 2005 23:42:40 -0500, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >>> Would it be possible, at least for Windows, to write a Python script >>> implementing a 'virtual distribution'? IE, download Python, install it, >>> download next package, install it, etc. -- prefereably table drive

Re: Embedding a restricted python interpreter

2005-01-07 Thread Peter Maas
Paul Rubin schrieb: Best solution would probably be to create a thread for each request that can operate only with the id of an authenticated user. But this seems to be a problem with Apache or with Linux? Threads wouldn't do it--you'd need separate processes. For example, multiple threads in the

Getting rid of "self."

2005-01-07 Thread BJörn Lindqvist
I think it would be cool if you could refer to instance variables without prefixing with "self." I know noone else thinks like me so Python will never be changed, but maybe you can already do it with Python today? .import sys . .def magic(): .s = "" .for var in sys._getframe(1).f_locals["s

Python application extending, plugins

2005-01-07 Thread John Pote
Hi, Has anyone any thoughts on structuring a program so that it can be extended simply and elegantly by a user who only has a compiled (.pyc) version of the application? I wish to write an application, myApp, that provides a GUI to, amongst other things, a simulator implimented as a class. myA

Re: 2 versions of python on 1 machine

2005-01-07 Thread flupke
Peter Hansen wrote: On my machine, I have a folder called c:\bin where I put useful batch files. I have a python23.bat and a python24.bat file, which basically just call c:\python23\python.exe or c:\python24\python.exe as required. For various reasons which may or may not apply to you as well, I

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Jacek Generowicz
"Anna" <[EMAIL PROTECTED]> writes: > Having taken some calculus (derivatives, limits, some integrals) but > never even heard of lambda calculus, to me, lambda means absolutely > NOTHING. Less than nothing. And before you took calculus, the chances are that derivatives, limits and integrals meant

Re: Python Operating System???

2005-01-07 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Christopher Koppler <[EMAIL PROTECTED]> writes Still, Java feels like C++ done right, while being more wrong >:-[ Couldn't disagree more. Just about anything you want to do that is low-level, is impossible in Java. Anyway this is off-topic. Stephen -- Stephen Kell

Re: Python Operating System???

2005-01-07 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Arich Chanachai <[EMAIL PROTECTED]> writes think). Or what about D? Digital Mars have a D compiler. http://www.digitalmars.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk

Re: Getting rid of "self."

2005-01-07 Thread Bruno Desthuilliers
BJörn Lindqvist a écrit : I think it would be cool if you could refer to instance variables without prefixing with "self." I know noone else thinks like me so Python will never be changed, but maybe you can already do it with Python today? (snip code) It works! exec(magic()) does the needed hi = se

Re: Python evolution: Unease

2005-01-07 Thread Alex Martelli
Paul Rubin wrote: ... > > GUI/IDEs for Python, > > I remember there was a gud interface for Python but it didn't work > pretty well. There's also IDLE which is pretty crude and flaky. I > think I'll just wait for Pypy deployment before worrying about this > situati

Re: Asyncore

2005-01-07 Thread Jp Calderone
On 7 Jan 2005 00:14:26 -0800, [EMAIL PROTECTED] wrote: >Is there any tutorial and docs with samples how to use asyncore module? See these threads: http://mail.python.org/pipermail/python-list/2004-March/214105.html http://mail.python.org/pipermail/python-dev/2004-November/049819.html

countint words from an input string

2005-01-07 Thread Øystein Western
Hello! Try to write som code that will get an input string from the user. Futher more, I'd like to have the program to count all the word the user has written. Startet out like this: /- s = raw_input("Write a text line") print s.split() / How can I count the words

Re: countint words from an input string

2005-01-07 Thread Simon Brunning
On Fri, 7 Jan 2005 15:58:06 +0100, Øystein Western <[EMAIL PROTECTED]> wrote: > Try to write som code that will get an input string from the user. Futher > more, I'd like to have the program to count all the word the user has > written. > > Startet out like this: > > /- > s = raw_inpu

Re: Getting rid of "self."

2005-01-07 Thread Nick Coghlan
BJörn Lindqvist wrote: So I'm asking here if someone knows a better way, maybe using decorators or metaclasses or other black magic? Wait for Python 3k when this will work: class c: def __init__(self): with self: .x = 1 .y = 2 .hi = "Hi there!" Cheers, Nick. -- Nick Coghlan

Re: 2 versions of python on 1 machine

2005-01-07 Thread Nick Coghlan
flupke wrote: Peter Hansen wrote: The content of each batch file is like this: @echo off c:\python23\python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 More recent versions of Windows should allow you to use %* for "all the arguments to the batch file". Where did you find more info on PYTHONHOME and PYTHONPAT

Re: sorting on keys in a list of dicts

2005-01-07 Thread Nick Coghlan
Jeff Shannon wrote: I suppose that your version has the virtue that, if the sortkey value is equal, items retain the order that they were in the original list, whereas my version will sort them into an essentially arbitrary order. Is there anything else that I'm missing here? Stability in sorti

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Steven Bethard
Alan Gauld wrote: On Thu, 06 Jan 2005 21:02:46 -0600, Doug Holton <[EMAIL PROTECTED]> wrote: used, but there are people who do not like "lambda": http://lambda-the-ultimate.org/node/view/419#comment-3069 The word "lambda" is meaningless to most people. Of course so is "def", which might be why Gu

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Nick Coghlan
Jacek Generowicz wrote: [*] Funnily enough, getting them to understand that "lambda x: fn(x)" is just a very silly way of writing "fn", can be quite a struggle at times ... but that's probably a consequence of the context in which lambda is introduced. If you genuinely taught them that,

Re: Calling Function Without Parentheses!

2005-01-07 Thread Kamilche
Yeah, but still. If they even had the most basic check, like 'an object is being referred to on this line, but you're not doing anything with it' would be handy in catching that. When you use an object like that, usually you're doing something with it, like assigning it to a variable. -- http://m

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Nick Coghlan
Paul Rubin wrote: "Anna" <[EMAIL PROTECTED]> writes: Having taken some calculus (derivatives, limits, some integrals) but never even heard of lambda calculus, to me, lambda means absolutely NOTHING. Less than nothing. Lambda calculus is from mathematical logic, but more to the point "lambda" has b

Re: missing sys.setappdefaultencoding

2005-01-07 Thread Craig Ringer
On Fri, 2005-01-07 at 19:06, Alex Martelli wrote: > Uwe Mayer <[EMAIL PROTECTED]> wrote: > > well, I wrote a nice python program which won't work if the default encoding > > has not been set from ascii to latin-1 or latin-15. > > Then your program is not very nice...;-) Agreed. I prefer to use e

[Pyro] Newbie Question Regarding Pyro

2005-01-07 Thread John French
I'm putting together a new project which I'm using to learn Python and have questions about pyro. I like the idea of the abstraction that pyro offers from sockets programming but I cannot determine if I'm giving up some possibly needed functionality. If the server needs to send an unsolicited a

Re: Getting rid of "self."

2005-01-07 Thread Luis M. Gonzalez
You can do it easier now without any black magic: class c: def __init__(s): s.x = 1 s.y = 2 s.hi = "Hi there!" The word "self" is not mandatory. You can type anything you want instead of self, as long as you supply a keyword in its place (it can be "self", "s" or whatever you want). -- http://m

Re: Getting rid of "self."

2005-01-07 Thread Simon Brunning
On 7 Jan 2005 08:10:14 -0800, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote: > The word "self" is not mandatory. You can type anything you want > instead of self, as long as you supply a keyword in its place (it can > be "self", "s" or whatever you want). You *can*, yes, but please don't, not if ther

Re: Please Contribute Python Documentation!

2005-01-07 Thread Nick Coghlan
Skip Montanaro wrote: Fred Drake releases new development versions of the docs frequently (typically once every month or two). I normally use the development docs instead of the regular ones for my day-to-day work. They are available here: http://www.python.org/dev/doc/devel/ It's useful to c

Re: Python evolution: Unease

2005-01-07 Thread Scott David Daniels
Terry Reedy wrote: Even though I currently only have 80 ... I realize that my stinginess > with disk space for more serious stuff is obsolete. A gigabyte would > cover Python + Wxpython + numarray + scipy + pygame + a lot of other stuff. Would it be possible, at least for Windows, to write a Pytho

RE: [Pyro] Newbie Question Regarding Pyro

2005-01-07 Thread Tim Golden
[John French] | I'm putting together a new project which I'm using to learn | Python and have questions about pyro. You're welcome to ask here, but you might find that posting on Pyro's own mailing list produces answers from people who don't follow c.l.py's higher traffic. | If the server needs

Re: sorting on keys in a list of dicts

2005-01-07 Thread It's me
What does it mean by "stability in sorting"? Can somebody please give a sample for using the code posted? I am a little lost here and I like to know more about the use of keys Thanks, "Nick Coghlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jeff Shannon wrote: > > I supp

Re: Getting rid of "self."

2005-01-07 Thread Roy Smith
Simon Brunning <[EMAIL PROTECTED]> wrote: >On 7 Jan 2005 08:10:14 -0800, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote: >> The word "self" is not mandatory. You can type anything you want >> instead of self, as long as you supply a keyword in its place (it can >> be "self", "s" or whatever you want).

function field in logging formatting

2005-01-07 Thread vmalloc
Hi all. I don't know if this topic has been proposed yet, but I'll try anyways. I thought it would be nice for the built-in version of the logging package (which, I might add, is excellent) to contain a "function" formatting field for log output. It wouldn't be so hard to implement, and it certain

Re: Getting rid of "self."

2005-01-07 Thread John Roth
"BJörn Lindqvist" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I think it would be cool if you could refer to instance variables without prefixing with "self." I know noone else thinks like me so Python will never be changed, but maybe you can already do it with Python today? ...

Re: Getting rid of "self."

2005-01-07 Thread Michael Hobbs
Nick Coghlan <[EMAIL PROTECTED]> wrote: > > Wait for Python 3k when this will work: > > class c: > def __init__(self): > with self: > .x = 1 > .y = 2 > .hi = "Hi there!" Python is looking more like JavaScript every day... -- http://mail.python.org/mailman/listinfo/pytho

Packaging, dependencies and rates of development

2005-01-07 Thread Nick Coghlan
Bulba! wrote: When you have it ALL in the single distro, released from time to time, you can easily test it _together_. You don't get _temporal dependencies between various versions_. The released, stable distro has the same things on the same days, and either it all works together or it doesn't.

Re: Getting rid of "self."

2005-01-07 Thread BJörn Lindqvist
Thank you for your replies. But they don't deal with my original question. :) I have read the thousands of posts all saying "self is good" and they are right. But this time I want to be different m-kay? I figure that there might be some way to solve my problem by doing this: .def instancevar2local

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Jacek Generowicz
Nick Coghlan <[EMAIL PROTECTED]> writes: > Jacek Generowicz wrote: > > [*] Funnily enough, getting them to understand that "lambda x: fn(x)" > > is just a very silly way of writing "fn", can be quite a struggle > > at times ... but that's probably a consequence of the context in > > wh

Re: Getting rid of "self."

2005-01-07 Thread John Roth
"Roy Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Simon Brunning <[EMAIL PROTECTED]> wrote: On 7 Jan 2005 08:10:14 -0800, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote: The word "self" is not mandatory. You can type anything you want instead of self, as long as you supply a key

Re: Python Operating System???

2005-01-07 Thread Michael Hobbs
David Brown <[EMAIL PROTECTED]> wrote: > Hello. I recently came across a free operating system called Unununium (or > something like that) and it was developed in Python and Assembly. > > Now, I have been looking for a way to make an operating system for a long > long time and the only possibiliti

Re: sorting on keys in a list of dicts

2005-01-07 Thread Craig Ringer
On Sat, 2005-01-08 at 00:26, It's me wrote: > What does it mean by "stability in sorting"? If I understand correctly, it means that when two sorts are performed in sequence, the keys that are equal to the second sort end up ordered the way they were left by the first sort. I'm far from certain of

how to extract columns like awk $1 $5

2005-01-07 Thread Anand S Bisen
Hi Is there a simple way to extract words speerated by a space in python the way i do it in awk '{print $4 $5}' . I am sure there should be some but i dont know it. Thanks n00b -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting on keys in a list of dicts

2005-01-07 Thread Nick Coghlan
It's me wrote: What does it mean by "stability in sorting"? Can somebody please give a sample for using the code posted? I am a little lost here and I like to know more about the use of keys It's the jargon for what Jeff said - if you are sorting by some value calculated from each list entry,

Re: The Industry choice

2005-01-07 Thread Bulba!
On 6 Jan 2005 19:01:46 -0500, [EMAIL PROTECTED] (Aahz) wrote: >>Note that the so-called 'viral' nature of GPL code only applies to >>*modifications you make* to the GPL software. The *only* way in which >>your code can be 'infected' by the GPL is if you copy GPL source. >That's not true -- con

Re: Getting rid of "self."

2005-01-07 Thread Roy Smith
In article <[EMAIL PROTECTED]>, John Roth <[EMAIL PROTECTED]> wrote: > >"Roy Smith" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> Simon Brunning <[EMAIL PROTECTED]> wrote: >>>On 7 Jan 2005 08:10:14 -0800, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote: The word "self" is not ma

Notification of PEP Updates

2005-01-07 Thread Nick Coghlan
I can't recall which thread this came up in, so I'm starting a new one. . . Barry Warsaw has kindly added a "peps" topic to the python-checkins mailing list. If you want to be notified only when PEP's get updated, then subscribe to python-checkins and edit your settings to select just the 'peps'

Re: sorting on keys in a list of dicts

2005-01-07 Thread Tim Peters
[Nick Coghlan] ... > Python 2.3 has a stable sort, and Python 2.4 brought the guarantee that it > shall > remain that way. I'm not sure about Python 2.2 and earlier. No list.sort() implementation before 2.3 was stable. It was confusing, though, because the samplesort/binary_insertion_sort hybrid

Re: sorting on keys in a list of dicts

2005-01-07 Thread Nick Coghlan
Craig Ringer wrote: Well, that's several hundred more words than were probably required, but I hope I made sense. Remarkably similar to what I just posted. . . I guess numeric 2-tuples are just too good to pass up when discussing sorting :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED]

Re: how to extract columns like awk $1 $5

2005-01-07 Thread Craig Ringer
On Sat, 2005-01-08 at 01:15, Anand S Bisen wrote: > Hi > > Is there a simple way to extract words speerated by a space in python > the way i do it in awk '{print $4 $5}' . I am sure there should be some > but i dont know it. The 'str.split' method is probably what you want: .>>> x = "The confu

Re: sorting on keys in a list of dicts

2005-01-07 Thread Scott David Daniels
Jeff Shannon wrote: Jp Calderone wrote: L2 = [(d[key], i, d) for (i, d) in enumerate(L)] L2.sort() L = [d for (v, i, d) in L2] Out of curiosity, any reason that you're including the index? Others have already remarked that this preserves sort stability (which is, in fact a lovely proper

Re: how to extract columns like awk $1 $5

2005-01-07 Thread beliavsky
It takes a few more lines in Python, but you can do something like for text in open("file.txt","r"): words = text.split() print words[4],words[5] (assuming that awk starts counting from zero -- I forget). -- http://mail.python.org/mailman/listinfo/python-list

Re: how to extract columns like awk $1 $5

2005-01-07 Thread Jeremy Sanders
On Fri, 07 Jan 2005 12:15:48 -0500, Anand S Bisen wrote: > Is there a simple way to extract words speerated by a space in python > the way i do it in awk '{print $4 $5}' . I am sure there should be some > but i dont know it. mystr = '1 2 3 4 5 6' parts = mystr.split() print parts[3:5] Jeremy

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Nick Coghlan
Jacek Generowicz wrote: Yes, I was wondering whether I should add lots of caveats to the above. I thought that might be the case. When teaching, I guess I can understand the need to avoid "well, technically, this isn't always true". It sounds like the students were having a tough enough time of i

Working with recordsets

2005-01-07 Thread [EMAIL PROTECTED]
Hi. I have one recorset that I would like to pass to 2 functions, one is for create an CSV file and the other one is to create a HTML file. The problem is that the recordset is totally read in the first function, and then when I pass it to the second funtion the recordset is in the last record. I

Re: Developing Commercial Applications in Python

2005-01-07 Thread Nick Coghlan
Stephen Waterbury wrote: A notable example is Verity's search engine -- see http://python.oreilly.com/news/PythonSS.pdf Not to mention the kind words of the current reigning king of the search engine world. . . Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --

python3: 'where' keyword

2005-01-07 Thread Andrey Tatarinov
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable sources. Usage could be something like: >>> res = [ f(i) for i in objects ] where: >>> def f(x): >>>

Re: Pre/Postconditions with decorators

2005-01-07 Thread George Sakkis
> Hi George, > it would be nice to see how you have tackled > the task. > Maybe we will have a checker > module in Python one day... ;-) I posted my module on http://rafb.net/paste/results/voZYTG78.html and its unit test on http://rafb.net/paste/results/MYxMQW95.html. Any feedback will be appreci

why not datetime.strptime() ?

2005-01-07 Thread josh
Shouldn't datetime have strptime? It already has strftime, and it'd be really nice to obviate datetime.fromtimestamp(time.mktime(time.strptime(...))) thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

pygtk swallowing external app

2005-01-07 Thread JiggaHertz
I am trying to write a gui with pygtk that swallows an external application. I've tried the plug/sockets example in the documentation modifying the plug to be an xterm. However, the xterm isn't swallowed by the python script. I have seen some c code which accomplishes this via an X reparent

Re: HTML purifier using BeautifulSoup?

2005-01-07 Thread Jonathan Clark
Dan Stromberg wrote: > Has anyone tried to construct an HTML janitor script using BeautifulSoup? > > My situation: > > I'm trying to convert a series of web pages from .html to palmdoc format, > using plucker, which is written in python. The plucker project suggests > passing html through "tidy",

Re: python3: 'where' keyword

2005-01-07 Thread Steven Bethard
Andrey Tatarinov wrote: Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable sources. Usage could be something like: >>> res = [ f(i) for i in objects ] where

  1   2   3   >