Re: Software archeology (was Re: Developing Commercial Applications in Python)

2005-01-07 Thread Stephen Waterbury
Aahz wrote: In article <[EMAIL PROTECTED]>, Stephen Waterbury <[EMAIL PROTECTED]> wrote: Aahz wrote: In article <[EMAIL PROTECTED]>, Stephen Waterbury <[EMAIL PROTECTED]> wrote: Also see Python Success Stories: http://pythonology.org/success A notable example is Verity's search engine -- see htt

vi and python

2005-01-07 Thread km
Hi all, Is there a way to display inbuilt function syntax as the user starts typing a function name with 'Vi' editor in console mode? tia, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw Sockets vs. What?

2005-01-07 Thread Matt
Just thought I'd follow up to say that I'm using XML-RPC after all. Not that I was intimidated when I finally learned that Fredrik had written the thing. No, it was more the issue that we want to write a php debugger next and XML-RPC plays well with php, too. Thanks again, --Matt -- http://mail.p

How to read/write blobs with mysqldb?

2005-01-07 Thread Christopher J. Bottaro
First off, writing the blob. From what I gather on the internet, I'm suppose to read the entire file into memory (a Python string), then create a dbiRaw object with that string and use the dbiRaw object in an insert statement? That doesn't sound very efficient to me. What if my computer only has

Re: _tkinter problem

2005-01-07 Thread Craig Ringer
On Sat, 2005-01-08 at 14:30, Jatinder Singh wrote: > Hi > I am running a script which is importing tkinter from > "/usr/local/lib/python2.3/lib-tk/Tkinter.py" and generating an error > " import _tkinter > ImportError: No module named _tkinter " > > can anybody tell me what is it? and how to get

Re: python3: 'where' keyword

2005-01-07 Thread michele . simionato
> But we're talking about the mythical/hypothetical Python 3, so maybe > there's a chance of fixing the scoping rules, which it seems to me are > currently pretty badly broken. I don't think the current scoping rules will be changed in Python 3.0. I can't give you the link right now, but there ar

Re: switching an instance variable between a property and a normal value

2005-01-07 Thread Nick Coghlan
Steven Bethard wrote: where I also accept *args and **kwds when the default value is to be called. It's certainly doable with a flag, but note that I have to check the flag every time in both __getitem__ and setdefault. Alternatively, always use a function for the default value, and set _func to

Re: python3: 'where' keyword

2005-01-07 Thread Nick Coghlan
Paul Rubin wrote: the suite has its own scope so any variable created there is local to the suite plus the following statement. The scope vanishes after the statement. The second part of the idea is to give the statement greater prominence and 'hide' the uninteresting setup (the contents of the w

Re: python3: 'where' keyword

2005-01-07 Thread Nick Coghlan
Nick Coghlan wrote: It also allows the necessary but uninteresting setup for an expression to be moved "out of the way", bringing the expression that does the real work to prominence. Killer app for this keyword: class C(object): x = property(get, set) where: def get(self): return "Si

Re: switching an instance variable between a property and a normal value

2005-01-07 Thread Nick Coghlan
Steven Bethard wrote: I'd like to be able to have an instance variable that can sometimes be accessed as a property, and sometimes as a regular value, e.g. something like: If you want the behaviour to be switchable per-instance, you have to go the route of always running through the property mac

Re: python3: 'where' keyword

2005-01-07 Thread Paul Rubin
Nick Coghlan <[EMAIL PROTECTED]> writes: > > Usage could be something like: > > >>> res = [ f(i) for i in objects ] where: > > >>> def f(x): > > >>> #do something > > Hmm, this is actually a really interesting idea. Avoiding accidental > namespace conflicts is certainly one of the a

_tkinter problem

2005-01-07 Thread Jatinder Singh
Hi I am running a script which is importing tkinter  from "/usr/local/lib/python2.3/lib-tk/Tkinter.py" and generating an error " import _tkinter ImportError: No module named _tkinter "   can anybody tell me what is it? and how to get away with it?   -- http://mail.python.org/mailman/listin

Re: sorting on keys in a list of dicts

2005-01-07 Thread Carl Banks
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? I'd > have expected to just do > > L2 = [(d[key], d) for d in L] >

Re: python3: 'where' keyword

2005-01-07 Thread Nick Coghlan
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

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

2005-01-07 Thread Carl Banks
Roy Smith wrote: > Hmmm. There's something going on here I don't understand. The ref > manual (3.3.5 Emulating container types) says for __getitem__(), "Note: > for loops expect that an IndexError will be raised for illegal indexes > to allow proper detection of the end of the sequence." I expec

Re: Help uninstalling/installing Python 2.4

2005-01-07 Thread Craig Ringer
On Sat, 2005-01-08 at 08:08, Baggs wrote: > Tk calls did not work, the output from Python when running a program > stated that I probably did not have TK installed. I got and installed > TK 8.4 and the problem persisted (I know I should have written down the > exact error, but I didn't... but

Here is $50 for signing up free

2005-01-07 Thread me to you
Hello, I'm trying out a new auto poster, and dont know how to use it very good, so if this end up in the wrong places, please forgive me, and disreguard, sorry for your incovenience, but everyone else, ENJOY!! KEEP READING TO GET YOUR $50.00 NOW!!! This is not spam, it is a legi

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

2005-01-07 Thread Roy Smith
Dan Valentine <[EMAIL PROTECTED]> wrote: > 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. > > i guess it dep

Re: Getting rid of "self."

2005-01-07 Thread Nick Coghlan
Roy Smith wrote: It's actually kind of neat, but boy does it play headgames with me when I switch back and forth between that and Python. Switching back and forth betwen C++ and Python plays headgames *anyway* }:> Cheers, Nick. Hardware control with Python is nice. . . -- Nick Coghlan | [EMAIL

Re: sorting on keys in a list of dicts

2005-01-07 Thread Nick Coghlan
Jeff Shannon wrote: Agreed. I'd started typing before I realized that it'd provide a stable sort, which pretty much answered my own question, but decided to send it anyhow in case I'd missed anything else... :) And it turns out we both missed the fact that it avoids comparing the dictionaries w

Re: What could 'f(this:that=other):' mean?

2005-01-07 Thread Nick Coghlan
If the caller is meant to supply a namespace, get them to supply a namespace. def f(ns1, ns2): print ns1['a'], ns1['b'], ns2['a'], ns2['b'] f(ns1 = dict(a=1, b=2), ns2 = dict(a=3, b=4)) Hey, where's Steve? Maybe his generic objects should be called namespaces instead of bunches. . . def f(ns1,

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

2005-01-07 Thread Dan Valentine
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. i guess it depends on how faithfully you want to reproduce awk's behav

Re: Getting rid of "self."

2005-01-07 Thread Roy Smith
Jeremy Bowers <[EMAIL PROTECTED]> wrote: > were I programming in C++ routinely now I'd prefix "this" and > dispense with that ugly "m_" garbage. (One of the things I ***hate*** > about C++ culture is its acceptance of hideously ugly variable names, > but now I'm two parentheticals deep so I prob

Re: Calling Function Without Parentheses!

2005-01-07 Thread Nick Coghlan
Kamilche wrote: Uh, you're right! I wouldn't want to bog Python down with even more checking at run time. I guess I'm asking for syntax checks that are typically done only with compiled languages. In that case, I can suggest having a look at Pychecker, which performs static sanity checks on Pytho

Re: Getting rid of "self."

2005-01-07 Thread Jeremy Bowers
On Fri, 07 Jan 2005 14:39:09 +0100, BJÃrn Lindqvist wrote: > It works! exec(magic()) does the needed hi = self.hi. No it doesn't. Try "hi = 'newValue'" and see what happens. So the next step is to write an "unmagic" function. So now how do you add instance variables? There is no way to avoid "se

Re: Software archeology (was Re: Developing Commercial Applications in Python)

2005-01-07 Thread Stephen Waterbury
Aahz wrote: In article <[EMAIL PROTECTED]>, Stephen Waterbury <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] writes: Can somebody there to point me any good commercial applications developed using python ? Also see Python Success Stories: http://pythonology.org/success A notable example is Verity's

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread Erik Max Francis
aurora wrote: Just gone though an article via Slashdot titled "The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software" [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the continous CPU performance gain we've seen is finally over. And that future gain

Python/Qt Problem

2005-01-07 Thread Michael
Hi, I am experiencing something very weird with PyQt. I have created several windows based on QWidget using Designer. I can easily hide and show these with the hide and show methods. However I have just created a new window with Designer and the show method works in my main script but not insid

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Roy Smith
In article <[EMAIL PROTECTED]>, James Stroud <[EMAIL PROTECTED]> wrote: > On Friday 07 January 2005 01:24 pm, Paul Rubin wrote: > > Nick Coghlan <[EMAIL PROTECTED]> writes: > > > Add in the fact that there are many, many Python programmers with > > > non-CS backgrounds, and the term 'lambda' stic

Re: DOS problem (simple fix??)

2005-01-07 Thread Brian van den Broek
Gavin Bauer said unto the world upon 2005-01-07 15:47: My DOS window (running in windows ME) closes the second it finishes running my programs. As you can imagine, this makes it hard to see the Thank you, and please make all answers simple enough to be understood by a highschool student and his fa

The limitation of the Photon Hypothesis

2005-01-07 Thread bill
Please reply to [EMAIL PROTECTED], thank you ! The limitation of the Photon Hypothesis According to the electromagnetic theory of light, its energy is related to the amplitude of the electric field of the electromagnetic wave, W=eE^2V(where E is the amplitude and V is the volume). It apparen

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread James Stroud
On Friday 07 January 2005 01:24 pm, Paul Rubin wrote: > Nick Coghlan <[EMAIL PROTECTED]> writes: > > Add in the fact that there are many, many Python programmers with > > non-CS backgrounds, and the term 'lambda' sticks out like a sore thumb > > from amongst Python's other English-based keywords. >

Re: Python evolution: Unease

2005-01-07 Thread Robert Kern
Scott David Daniels wrote: If you can wait, the plan for MacEnthon (Python 2.4 on Mac) looks great: Actually, just packages for 2.3 (or 2.3.x for Tiger) as of right now. When someone else packages up 2.4 nicely, I'll start making packages for that, too. http://www.scipy.org/wikis/featurerequ

Re: Python Operating System???

2005-01-07 Thread Arich Chanachai
Paul Rubin wrote: Arich Chanachai <[EMAIL PROTECTED]> writes: But I thought Python was an all-purpose language. After all, OS's have been written in Lisp before too. Pure Lisp? Or a Lisp/C/Asm combo? Lisp has a compiled flavor by the way. Compi

Re: Python Operating System???

2005-01-07 Thread Paul Rubin
Arich Chanachai <[EMAIL PROTECTED]> writes: > >But I thought Python was an all-purpose language. After all, OS's > >have been written in Lisp before too. > > > Pure Lisp? Or a Lisp/C/Asm combo? Lisp has a compiled flavor by the way. Compiled flavor? Lisp has been compiled since the 1950's.

Re: Python Operating System???

2005-01-07 Thread Arich Chanachai
Paul Rubin wrote: [EMAIL PROTECTED] (Michael Hobbs) writes: The problem when using Python instead of C for OS development is that C was *specifically designed* to create an OS, while Python was designed for completely different purposes. If you want to write an OS, it would be wise to use a lang

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread BJörn Lindqvist
The more features a language has, the harder it becomes to learn. An example of that is C++ which has almost everything. Classes, structs, templates, strange keywords that noone uses like auto, inline const, passing by reference/value, enum, union, lots of macros, multiple inheritance, namespaces e

Re: EOF for binary?

2005-01-07 Thread flamesrock
Thanks! I don't know why, but the most innefficient and unmaintanable means of doing something usually pops into my head before anything else. I solved this by going elif len(header) < 8: break -- http://mail.python.org/mailman/listinfo/python-list

Re: Notification of PEP Updates

2005-01-07 Thread Bengt Richter
On Fri, 07 Jan 2005 16:05:31 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> On Sat, 08 Jan 2005 03:28:34 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> >> >>>I can't recall which thread this came up in, so I'm starting a new one. . . >>> >>>Barry Warsaw has kindly a

Re: EOF for binary?

2005-01-07 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "flamesrock" <[EMAIL PROTECTED]> wrote: > Hi, > > So if I understand correctly, there are NO eof characters in any binary > file. If so, is there an easier way to check for the end of the file > than: > > os.path.getsize(infile) <= infile.tell() How you detect E

Publish your program for free and enjoy worry free earning. 100% !!!! FREE (AND WE MEAN IT - FREE)

2005-01-07 Thread DohnoSoft
Developers, please read this information. If you have some program or utility that you think may be interesting to somebody else, go ahead and submit it to www.dohnosoft.com This is 100% FREE!!! and DohnoSoft will take care of all issues related to sales, payments and customer support. You wil

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Steven Bethard
Alan Gauld wrote: On Fri, 07 Jan 2005 08:44:57 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: The unfamiliar argument doesn't work for me. After all most people are unfamiliar with complex numbers (or imaginary) numbers complex numbers. Lambdas, on the other hand, show up in all kinds of code,

EOF for binary?

2005-01-07 Thread flamesrock
Hi, So if I understand correctly, there are NO eof characters in any binary file. If so, is there an easier way to check for the end of the file than: os.path.getsize(infile) <= infile.tell() Because that returns the error: # File "/usr/lib/python2.3/posixpath.py", line 142, in getsize #ret

Re: Returning same type as self for arithmetic in subclasses

2005-01-07 Thread Tim Peters
[Max M] > """ > I subclass datetime and timedelta > > >>> dt = myDatetime(1970,1,1) > >>> type(dt) > > > >>> td = myTimedelta(hours=1) > >>> type(td) > > > But when I do arithmetic with these classes, they return datetime and > timedelta, ... > >>> new_time = dt + td > >>> new_time > datetime.

Re: Notification of PEP Updates

2005-01-07 Thread Skip Montanaro
Nick> Let us know if it does anything odd (e.g. sending updates about Nick> other checkins) Note that the lone criterion for inclusion is the word "PEP" in the subject or the first few lines of the message. You might thus see the occasional checkin message that mentions "PEP" but isn't d

Re: why not datetime.strptime() ?

2005-01-07 Thread Skip Montanaro
josh> Shouldn't datetime have strptime? Sure, but it's not quite as trivial to implement as was strftime() support. While strftime() is a C library function and thus easily called from within the datetime C code, strptime() is implemented in Python as part of the time module for portability (

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Terry Hancock
On Friday 07 January 2005 06:12 pm, Jeff Shannon wrote: > Paul Rubin wrote: > > > Richard Feynman told a story about being on a review committee for > > some grade-school science textbooks. One of these book said something > > about "counting numbers" and it took him a while to figure out that >

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Alan Gauld
On Fri, 07 Jan 2005 08:44:57 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > > The unfamiliar argument doesn't work for me. After all most > > people are unfamiliar with complex numbers (or imaginary) numbers > > complex numbers. Lambdas, on the other hand, show up in all kinds of > code, and

Re: OT: spacing of code in Google Groups

2005-01-07 Thread JanC
Peter Hansen schreef: > Steve Holden wrote: > >> Or even used cut(1) from the command line. > > Or myybe not :-) > > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > > c:\>cut > 'cut' is not recognized as an internal or external command, > operable program or

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Jeff Shannon
Paul Rubin wrote: Richard Feynman told a story about being on a review committee for some grade-school science textbooks. One of these book said something about "counting numbers" and it took him a while to figure out that this was a new term for what he'd been used to calling "integers". With all

Help uninstalling/installing Python 2.4

2005-01-07 Thread Baggs
Guys/Gals I've messed up my Python 2.4 install. I'm really new to Python (and Linux for that matter) and really wanted to try Python out. I have mandrake 10.1. The first thing I did was uninstalled via rpm Python 2.3 and Tkinter 8.3 (I now realize that was a mistake, since I could have both v

Re: AttributeError of a module instance

2005-01-07 Thread holger krekel
On Mon, Dec 26, 2005 at 17:41 +, Paolino wrote: > I'd like to catch AttributeError on the module level,so that I can > declare default bindings for useds defore definition.How is this to be > done?Thanks for help. It cannot be done directly but with a small hack. This is the idea: impor

Re: switching an instance variable between a property and a normal value

2005-01-07 Thread Steven Bethard
Robert Brewer wrote: Steven Bethard wrote: I'm playing around with a mapping type that uses setdefault as suggested in http://www.python.org/moin/Python3_2e0Suggestions. The default value for a missing key is either a simple value, or a value generated from a function. If it's generated fro

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread John Roth
"aurora" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello! Just gone though an article via Slashdot titled "The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software" [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the continous CPU perform

Re: Getting rid of "self."

2005-01-07 Thread Sean Ross
"BJörn Lindqvist" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] 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 ther

Re: Notification of PEP Updates

2005-01-07 Thread Steven Bethard
Bengt Richter wrote: On Sat, 08 Jan 2005 03:28:34 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: 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

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Bengt Richter
On 07 Jan 2005 13:24:39 -0800, Paul Rubin wrote: >Nick Coghlan <[EMAIL PROTECTED]> writes: >> Add in the fact that there are many, many Python programmers with >> non-CS backgrounds, and the term 'lambda' sticks out like a sore thumb >> from amongst Python's other Englis

RE: Exception report library

2005-01-07 Thread Robert Brewer
Ian Bicking wrote: > I've been using one of several systems to catch unexpected > exceptions and log them (e.g., write to a file, display on > web page, email me, etc). But many are built into a > particular system, or have an interesting but incomplete > set of features... > I feel like there mu

Re: OT: google groups bug, or worse?

2005-01-07 Thread olsongt
[EMAIL PROTECTED] wrote: > I'm concerned that google groups is not correctly reflecting the > python lists. A month ago I announced the xsdbXML framework to the > python list and the python-announce list. As you can see from the > links > below the python announce submission was approved by the

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread Steve Horsley
Jack Diederich wrote: On Fri, Jan 07, 2005 at 01:35:46PM -0800, aurora wrote: Hello! Just gone though an article via Slashdot titled "The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software" [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the continous

Re: Tkinter, Alt, and Windows

2005-01-07 Thread Tim Daneliuk
Tim Daneliuk wrote: Arggg. I have a program that runs comfortably across both Unix variants and Windows ... except I wish to bind an Alt-ButtonRelease-3 combination to popup a menu. This works flawlessly under Unix, but with windows, the menu appears briefly and then disappears. I'm g

RE: switching an instance variable between a property and a normal value

2005-01-07 Thread Robert Brewer
Steven Bethard wrote: > I'm playing around with a mapping type that uses setdefault > as suggested > in http://www.python.org/moin/Python3_2e0Suggestions. The > default value > for a missing key is either a simple value, or a value > generated from a > function. If it's generated from the f

Re: OT: google groups bug, or worse?

2005-01-07 Thread Bengt Richter
On 7 Jan 2005 11:59:25 -0800, [EMAIL PROTECTED] wrote: >I'm concerned that google groups is not correctly reflecting the >python lists. A month ago I announced the xsdbXML framework to the >python list and the python-announce list. As you can see from the >links >below the python announce submis

Re: Notification of PEP Updates

2005-01-07 Thread Bengt Richter
On Sat, 08 Jan 2005 03:28:34 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: >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, th

Tkinter, Alt, and Windows

2005-01-07 Thread Tim Daneliuk
Arggg. I have a program that runs comfortably across both Unix variants and Windows ... except I wish to bind an Alt-ButtonRelease-3 combination to popup a menu. This works flawlessly under Unix, but with windows, the menu appears briefly and then disappears. I'm guessing that Alt under

Re: The Industry choice

2005-01-07 Thread Stefan Axelsson
Bulba! wrote: Oh, and by the way - since Python bytecode can be relatively easily decompiled to source, could it interpreted to "really" count as source code and not binary? What are the consequences of releasing code _written in Python_ as GPLed? Well, to your first question, in a word 'no', i

Re: switching an instance variable between a property and a normal value

2005-01-07 Thread Steven Bethard
Robert Brewer wrote: Steven Bethard wrote: I'd like to be able to have an instance variable that can sometimes be accessed as a property, and sometimes as a regular value, e.g. something like: ... py> c.x is c.x # I'd like this to be False You'd like 'c.x is c.x' to be FALSE? You can't be seri

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread Jack Diederich
On Fri, Jan 07, 2005 at 01:35:46PM -0800, aurora wrote: > Hello! > > Just gone though an article via Slashdot titled "The Free Lunch Is Over: A > Fundamental Turn Toward Concurrency in Software" > [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the > continous CPU perfo

Returning same type as self for arithmetic in subclasses

2005-01-07 Thread Max M
# -*- coding: latin-1 -*- """ I subclass datetime and timedelta >>> dt = myDatetime(1970,1,1) >>> type(dt) >>> td = myTimedelta(hours=1) >>> type(td) But when I do arithmetic with these classes, they return datetime and timedelta, where I want them to return myDatetime and myTimedelta >>> new_t

Re: Python Operating System???

2005-01-07 Thread Bengt Richter
On Fri, 07 Jan 2005 16:34:48 -, [EMAIL PROTECTED] (Michael Hobbs) wrote: >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 fo

Re: Tkinter: passing parameters to menu commands (looping through a list)

2005-01-07 Thread Philippe C. Martin
>>l_dec.add_command(label=i, command=lambda x=i: self.__Dec(x)) Woof! I'd better do my homework on lambda ! Thanks, Philippe -- *** Philippe C. Martin SnakeCard LLC www.snakecard.com *** -- http://mail.python.org/mailman/listinfo/python-list

Re: What could 'f(this:that=other):' mean?

2005-01-07 Thread Jonathan Fine
Jeff Shannon wrote: Jonathan Fine wrote: The use of *args and **kwargs allows functions to take a variable number of arguments. The addition of ***nsargs does not add significantly. I've posted usage examples elsewhere in this thread. I think they show that ***nsargs do provide a benefit. At l

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Bengt Richter
On 07 Jan 2005 14:38:01 +0100, Jacek Generowicz <[EMAIL PROTECTED]> 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 >

Re: Tkinter: passing parameters to menu commands (looping througha list)

2005-01-07 Thread Michael Fuhr
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > l_dec_list = ['ATR','IN'] > > for i in l_dec_list: > l_dec.add_command(label = i, command= lambda: self.__Dec(i)) Give the lambda an argument with a default: l_dec.add_command(label=i, command=lambda x=i: self.__Dec(x)) -- Michael Fuhr http:

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

2005-01-07 Thread Paul Rubin
[EMAIL PROTECTED] (Roy Smith) writes: > Something along the lines of: > > words = input.split() > print words[4], words[5] That throws an exception if there are fewer than 6 fields, which might or might not be what you want. -- http://mail.python.org/mailman/listinfo/python-list

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread Paul Rubin
aurora <[EMAIL PROTECTED]> writes: > Just gone though an article via Slashdot titled "The Free Lunch Is > Over: A Fundamental Turn Toward Concurrency in Software" > [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that > the continous CPU performance gain we've seen is finally ove

Re: Exception report library

2005-01-07 Thread Ian Bicking
Robert Brewer wrote: I've been using one of several systems to catch unexpected exceptions and log them (e.g., write to a file, display on web page, email me, etc). But many are built into a particular system, or have an interesting but incomplete set of features. E.g., many web frameworks ha

Re: Notification of PEP Updates

2005-01-07 Thread Erik Max Francis
Nick Coghlan wrote: 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 sel

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

2005-01-07 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Anand S Bisen <[EMAIL PROTECTED]> 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. Something along the lines of: words = input.split(

"A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread aurora
Hello! Just gone though an article via Slashdot titled "The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software" [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the continous CPU performance gain we've seen is finally over. And that future gain would

RE: Exception report library

2005-01-07 Thread Robert Brewer
Ian Bicking wrote: > I've been using one of several systems to catch unexpected exceptions > and log them (e.g., write to a file, display on web page, email me, > etc). But many are built into a particular system, or have an > interesting but incomplete set of features. E.g., many web > frame

Re: Tkinter: passing parameters to menu commands (looping through a list)

2005-01-07 Thread Philippe C. Martin
I face a strange behavior when adding menu labels / command parameters from a list: *** This is the code that works but I wish to avoid - ATR and IN appear in the menu, and __Dec is called with ATR or IN depending on the choice *** l_dec.add_command(label = 'ATR', command= lambda: self.__Dec('ATR

Re: args (was Re: Lambda as declarative idiom (was RE: what is lambda used for in real code?))

2005-01-07 Thread Bengt Richter
On Tue, 04 Jan 2005 14:11:51 -0800, Michael Spencer <[EMAIL PROTECTED]> wrote: [Hm, this didn't go out for some reason. I'll just send it now.] >Roman Suzi wrote: > >> Maybe this is too outlandish, but I see lambdas as a "quote" mechanism, >> which presents a possibility to postpone (precisely con

Re: DOS problem (simple fix??)

2005-01-07 Thread Paul Rubin
Gavin Bauer <[EMAIL PROTECTED]> writes: > Thank you, and please make all answers simple enough to be understood > by a highschool student and his father :) . You might like to try IDLE, which is included with Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: python3: 'where' keyword

2005-01-07 Thread Paul Rubin
Donn Cave <[EMAIL PROTECTED]> writes: > I don't by any means agree that this notation is worth adopting, and > in general I think this kind of readability issue is more or less a lost > cause for a language with Python's scoping rules, but the motive makes > sense to me. But we're talking about

Re: Other notes

2005-01-07 Thread Bengt Richter
On Fri, 07 Jan 2005 06:04:01 GMT, Andrew Dalke <[EMAIL PROTECTED]> 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 gr

Re: Python Operating System???

2005-01-07 Thread Paul Rubin
[EMAIL PROTECTED] (Michael Hobbs) writes: > The problem when using Python instead of C for OS development is that > C was *specifically designed* to create an OS, while Python was designed > for completely different purposes. If you want to write an OS, it would > be wise to use a language that is

RE: switching an instance variable between a property and a normal value

2005-01-07 Thread Robert Brewer
Steven Bethard wrote: > I'd like to be able to have an instance variable that can > sometimes be > accessed as a property, and sometimes as a regular value, > e.g. something > like: ... > py> c.x is c.x # I'd like this to be False You'd like 'c.x is c.x' to be FALSE? You can't be serious. Must

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Paul Rubin
Nick Coghlan <[EMAIL PROTECTED]> writes: > Add in the fact that there are many, many Python programmers with > non-CS backgrounds, and the term 'lambda' sticks out like a sore thumb > from amongst Python's other English-based keywords. 'def' is probably > the second-most cryptic when you first enco

Re: What could 'f(this:that=other):' mean?

2005-01-07 Thread Jonathan Fine
Jonathan Fine wrote: I'll post some usage examples later today, I hope. Well, here are some examples. A day later, I'm afraid. ** Pipelines and other composites This is arising for me at work. I produce Postscript by running TeX on a document. And then running dvips on the output of TeX. TeX as

Re: DOS problem (simple fix??)

2005-01-07 Thread Daniel Bickett
I tend to run "cmd" and "cd" to the directory of the script, then run it. This way, the window doesn't close, and I can read any errors that occur without interruption. Optionally, you can run "cmd" and simply drag the script you want to run into the window. That pastes its path (in quotes) into th

Re: DOS problem (simple fix??)

2005-01-07 Thread beliavsky
When I have a Python script generating a lot of output, I either open an output file and then print to it with fp = open("results.txt","w") print>>fp,"stuff" or I redirect output to a file from the command line using ">" (also works on Unix), for example python foo.py > results.txt An alternati

Re: Tkinter: using a Listbox

2005-01-07 Thread Steve
> #Listbox > self.listbox = Listbox(self.selectFrame) > self.listbox.insert(END, "a list entry") > for item in ["A","B","C"]: > self.listbox.insert(END, item) Don't forget to pack the listbox. You may find this useful... http://www.ferg.org/thinking_in_tkinter/index.html -- http://mail.py

Re: Tkinter: passing parameters to menu commands

2005-01-07 Thread Philippe C. Martin
>>menu.add_cascade(label="File", menu=filemenu) >>filemenu.add_command(label="New", command=lambda: callback('New')) >>filemenu.add_command(label="Open...", command=lambda: callback('Open')) >>filemenu.add_separator() >>filemenu.add_command(label="Exit", command=lambda: callback('Exit')) mainloop()

RE: Display Function Code Body?

2005-01-07 Thread Robert Brewer
Haibao Tang wrote: > Hail Python pals! I played with the R (http://r-project.cran.org) last > night to do some statistics and it has an interactive session too, and > I found a feature that is quite useful. > > I found by actually typing a function name, the R gives you a > code body output. > >

RE: DOS problem (simple fix??)

2005-01-07 Thread Robert Brewer
Gavin Bauer wrote: > My DOS window (running in windows ME) closes the second it finishes > running my programs. As you can imagine, this makes it hard to see the > results. I've gotten in the habit of putting raw_input("Press enter to > exit") at the end of every program, and in addition to being p

Re: sorting on keys in a list of dicts

2005-01-07 Thread Jeff Shannon
Nick Coghlan wrote: 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

Re: The Industry choice

2005-01-07 Thread Scott Robinson
On Fri, 07 Jan 2005 12:06:42 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote: >Bulba! wrote: > >> 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

Software archeology (was Re: Developing Commercial Applications in Python)

2005-01-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Stephen Waterbury <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] writes: >>> >>>Can somebody there to point me any good commercial applications >>>developed using python ? > >Also see Python Success Stories: http://pythonology.org/success > >A notable example is

Tkinter: using a Listbox

2005-01-07 Thread Ebba Cecilia Ovesdotter Alm
Hello, I'm learning how to use the Tkinter module. I would like to use an element similar to a drop-down form, where the user can select one option out of many. I thought that a Listbox item could do just this. The following extract from my code (with the listbox part basically mirroring http://ef

  1   2   3   >