Re: Using a browser as a GUI: which Python package

2006-04-28 Thread André
Problem solved using CherryPy. See http://aroberge.blogspot.com/2006/04/cherrypy-is-great.html for the details. -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-web-based templating system

2006-04-28 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Actually, that looks even better that EmPy for what I need. :-( -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis All bad poetry springs from genuine feeling. -- Oscar Wilde -- ht

Re: Non-web-based templating system

2006-04-28 Thread qscomputing
Actually, that looks even better that EmPy for what I need. I will try out these suggestions and then see what seems best. Thanks very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread John Bokma
"Tagore Smith" <[EMAIL PROTECTED]> wrote: > Try > sending mail to abuse at (any of my) desmesne(s). You won't get a > response- in fact, no-one will read your mail. Then you come close to being RFC ignorant IMO. Couldn't be bothered to check it out. > I'm not sure that Xah's post was offtopic,

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread Tagore Smith
John Bokma wrote: > "Tagore Smith" <[EMAIL PROTECTED]> wrote: > > > Your emails to his ISP > > are far more wasteful- you are using up very scarce resources > > dedicated to dealing with real abuse. > > According to his hosting provider dreamhost: > > I have warned this user that excessive offtopi

python-dev Summary for 2006-03-01 through 2006-03-15

2006-04-28 Thread Steven Bethard
python-dev Summary for 2006-03-01 through 2006-03-15 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-03-01_2006-03-15] = Announcements = ---

python-dev Summary for 2006-02-16 through 2006-02-28

2006-04-28 Thread Steven Bethard
python-dev Summary for 2006-02-16 through 2006-02-28 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-02-16_2006-02-28] = Announcements = ---

python-dev Summary for 2006-02-01 through 2006-02-15

2006-04-28 Thread Steven Bethard
python-dev Summary for 2006-02-01 through 2006-02-15 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-02-01_2006-02-15] = Announcements =

python-dev Summary for 2006-01-16 through 2006-01-31

2006-04-28 Thread Steven Bethard
Sorry the summaries are so late. We were late already, and it's taken me a bit of time to get set up with the new python.org site. But I should be all good now, and hopefully we'll get caught up with all the summaries by the end of May. Hope you all weren't too depressed without your bi-weekly p

Re: not quite 1252

2006-04-28 Thread Martin v. Löwis
Anton Vredegoor wrote: >> So if that is the case: What is the problem then? If you interpret >> the document as cp1252, and it contains \x93 and \x94, what is >> it that you don't like about that? In yet other words: what actions >> are you performing, what are the results you expect to get, and >>

Re: Popping from the middle of a deque + deque rotation speed

2006-04-28 Thread Tim Peters
[Russell Warren] |> Does anyone have an easier/faster/better way of popping from the middle > of a deque than this? > > class mydeque(deque): > def popmiddle(self, pos): > self.rotate(-pos) > ret = self.popleft() > self.rotate(pos) > return ret As Tim Chase said, the easiest way

Re: MinGW and Python

2006-04-28 Thread Martin v. Löwis
Ross Ridge wrote: > I think that having current versions of Python also linked MSVCRT.DLL, > whether compiled with MinGW or MSVC 6, 7 or 8, could be over all be a > better solution than using a CRT DLL specific to one version of > Microsoft's compiler. It would make it possible to build extentions

Weekly Python Patch/Bug Summary

2006-04-28 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 378 open ( +7) / 3199 closed ( +4) / 3577 total (+11) Bugs: 901 open ( -7) / 5792 closed (+25) / 6693 total (+18) RFE : 214 open ( +3) / 214 closed ( +2) / 428 total ( +5) New / Reopened Patches __ Allow PyA

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread James Stroud
Tagore Smith wrote: > I generally enjoy his posts. You should be happy then that they have all been archived on his website for quite some time. I'm thinking of cross-posting Soren Keirkegaards _Either/Or_. Its been archived for a while now and is full of nonsensical ramblings, but I feel the

Re: GUI slider control

2006-04-28 Thread James Stroud
[EMAIL PROTECTED] wrote: > Could someone tell me the easiest way to create a GUI slider control in > Python? > This is how we do it in the hood: from Tkinter import * def callback(value): print value tk = Tk() s = Scale(tk, orient=HORIZONTAL, command=callback) s.pack() tk.mainloop() I'm

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread John Bokma
"Tagore Smith" <[EMAIL PROTECTED]> wrote: > Your emails to his ISP > are far more wasteful- you are using up very scarce resources > dedicated to dealing with real abuse. According to his hosting provider dreamhost: I have warned this user that excessive offtopic cross-posting is not allowed, a

Re: convert a int to a list

2006-04-28 Thread James Stroud
Tim Chase wrote: >> >> a = ['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]] >> >> As an exercise, write a loop that traverses the previous list and >> prints the length of each element. What happens if you send an

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread Tagore Smith
John Bokma wrote: > "Tagore Smith" <[EMAIL PROTECTED]> wrote: > > > It's much easier to use a killfile than to complain to an ISP, and I > > think that that should be the preferred response to messages you don't > > like. > > No, since even if you kill file Xah Lee, he keeps wasting resources of >

Re: best way to determine sequence ordering?

2006-04-28 Thread Kent Johnson
I V wrote: > Incidentally, does python have a built-in to do a binary search on a > sorted list? Obviously it's not too tricky to write one, but it would be > nice if there was one implemented in C. See the bisect module. Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread Tagore Smith
Kaz Kylheku wrote: > Chris Uppal wrote: > > Tagore Smith wrote: > > > > > It's much easier to use a killfile than to complain to an ISP, and I > > > think that that should be the preferred response to messages you don't > > > like. > > > > I'm inclined to agree. The problem is not Xah Lee (whom I

Re: Using a browser as a GUI: which Python package

2006-04-28 Thread John Bokma
"André" <[EMAIL PROTECTED]> wrote: > John Bokma wrote: >> Also note that if your result takes some time you need to send dummy >> headers every now and then to keep the connection alive. And even >> then there might be problems with time outs. > > I don't see why I would have problems with time

Recommendations for a PostgreSQL db adapter, please?

2006-04-28 Thread Keen Anthony
Hello, I am currently using psycopg 2 as my db adapter for a mod_python & PostgreSQL web app. It's works fine, and I haven't any complaints. I would appreciate some input on what other pythonistas like in an adapter. There were several different options available to me, but there was no partic

Re: best way to determine sequence ordering?

2006-04-28 Thread I V
On Fri, 28 Apr 2006 16:39:33 -0700, nikie wrote: > I V wrote: >> Do you need the generator expression here? dict(enumerate(L)) should be >> equivalent, no? > > I think the generator is needed to swap the item and the index. > dict(enumerate(L)) would yield a dict like {0:'C', 1:'A'...} Oh, of cou

Using a browser as a GUI: which Python package

2006-04-28 Thread André
First, an apology: I realise that I don't know enough about what I am asking to make sure to use the proper language to phrase my question. I would like to use a browser (e.g. Firefox) as a simple GUI "framework". Note that this is to be done on a single user machine, so the question of sandboxin

Re: convert a int to a list

2006-04-28 Thread [EMAIL PROTECTED]
Tim Chase wrote: > > > > a = ['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]] > > > > As an exercise, write a loop that traverses the previous list and > > prints the length of each element. What happens if you sen

Re: Using a browser as a GUI: which Python package

2006-04-28 Thread André
John Bokma wrote: > "André" <[EMAIL PROTECTED]> wrote: [snip] > > > > I would like to use a browser (e.g. Firefox) as a simple GUI > > "framework". Note that this is to be done on a single user machine, so > > the question of sandboxing is not really relevant here. > > [snip] > > > > Ideally, I w

Re: Using a browser as a GUI: which Python package

2006-04-28 Thread John Bokma
"André" <[EMAIL PROTECTED]> wrote: > First, an apology: I realise that I don't know enough about what I am > asking to make sure to use the proper language to phrase my question. > > I would like to use a browser (e.g. Firefox) as a simple GUI > "framework". Note that this is to be done on a sin

Re: Non-web-based templating system

2006-04-28 Thread has
bruno at modulix wrote: > Else you may want to look at: > - http://www.python.org/doc/2.4.2/whatsnew/node5.html > - empy : http://www.alcyone.com/pyos/empy/ > - cheetah : http://www.cheetahtemplate.org/ Also texttemplate (one of mine): http://freespace.virgin.net/hamish.sanderson/texttemplate.ht

Re: best way to determine sequence ordering?

2006-04-28 Thread Steven Bethard
nikie wrote: > Steven Bethard wrote: > >> John Salerno wrote: >>> If I want to make a list of four items, e.g. L = ['C', 'A', 'D', 'B'], >>> and then figure out if a certain element precedes another element, what >>> would be the best way to do that? >>> >>> Looking at the built-in list functions,

Using a browser as a GUI: which Python package

2006-04-28 Thread André
First, an apology: I realise that I don't know enough about what I am asking to make sure to use the proper language to phrase my question. I would like to use a browser (e.g. Firefox) as a simple GUI "framework". Note that this is to be done on a single user machine, so the question of sandboxin

Re: best way to determine sequence ordering?

2006-04-28 Thread nikie
I V wrote: > On Fri, 28 Apr 2006 14:27:00 -0700, nikie wrote: > > Steven Bethard wrote: > > > >> >>> L = ['C', 'A', 'D', 'B'] > >> >>> positions = dict((item, i) for i, item in enumerate(L)) > > Do you need the generator expression here? dict(enumerate(L)) should be > equivalent, no? I think th

Re: convert a int to a list

2006-04-28 Thread Tim Chase
> > a = ['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]] > > As an exercise, write a loop that traverses the previous list and > prints the length of each element. What happens if you send an > integer to len?

Re: Popping from the middle of a deque + deque rotation speed

2006-04-28 Thread Tim Chase
> Does anyone have an easier/faster/better way of popping from the middle > of a deque than this? > > class mydeque(deque): > def popmiddle(self, pos): > self.rotate(-pos) > ret = self.popleft() > self.rotate(pos) > return ret My first thought would just be to use indexing:

iputils module

2006-04-28 Thread bob
Anyone know where to get the iputils module for python? -- http://mail.python.org/mailman/listinfo/python-list

RE: Undocumented alternate form for %#f ?

2006-04-28 Thread Dino Viehland
Ahh, cool... Thanks for the explanation! Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Hugh

Popping from the middle of a deque + deque rotation speed

2006-04-28 Thread Russell Warren
Does anyone have an easier/faster/better way of popping from the middle of a deque than this? class mydeque(deque): def popmiddle(self, pos): self.rotate(-pos) ret = self.popleft() self.rotate(pos) return ret I do recognize that this is not the intent of a deque, given the clear

Re: best way to determine sequence ordering?

2006-04-28 Thread I V
On Fri, 28 Apr 2006 14:27:00 -0700, nikie wrote: > Steven Bethard wrote: > >> >>> L = ['C', 'A', 'D', 'B'] >> >>> positions = dict((item, i) for i, item in enumerate(L)) Do you need the generator expression here? dict(enumerate(L)) should be equivalent, no? > Isn't this bound to be less effici

GUI slider control

2006-04-28 Thread mike7411
Could someone tell me the easiest way to create a GUI slider control in Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread John Bokma
"Kaz Kylheku" <[EMAIL PROTECTED]> wrote: > What is the point of killfiling Xah Lee? Xah Lee does not enter into > random debates. My point. Xah Lee doesn't follow netiquette, which is nowadays with quite some ISPs a ToS violation. [ ... ] > If you truly don't like this stuff, maybe you shoul

Re: Xah's Edu Corner: What Languages to Hate

2006-04-28 Thread John Bokma
"Kaz Kylheku" <[EMAIL PROTECTED]> wrote: > John Bokma wrote: >> Alex Buell <[EMAIL PROTECTED]> wrote: >> >> > Send your complaints to: >> > abuse at sbcglobal dott net >> > abuse at dreamhost dott com >> >> Yup, done. If he's still with dreamhost he probably is in trouble >> now. If not, next. >

Re: an error in commented code?

2006-04-28 Thread John Salerno
Gerard Flanagan wrote: > I don't think you need all those 'ifs'. > > groups = [group1, group2, group3, group4] > > def checkOrder(x, y): > x_votes = 0 > y_votes = 0 > for group in groups: > if group.index(x) < group.index(y): > x_votes += group[4] > else:

Re: best way to determine sequence ordering?

2006-04-28 Thread nikie
Steven Bethard wrote: > John Salerno wrote: > > If I want to make a list of four items, e.g. L = ['C', 'A', 'D', 'B'], > > and then figure out if a certain element precedes another element, what > > would be the best way to do that? > > > > Looking at the built-in list functions, I thought I could

Re: an error in commented code?

2006-04-28 Thread Gerard Flanagan
John Salerno wrote: > Here's my code, with the error following it: > > props = ['A', 'B', 'C', 'D'] > group1 = ['C', 'A', 'D', 'B', 17] > group2 = ['A', 'B', 'D', 'C', 32] > group3 = ['D', 'B', 'C', 'A', 34] > group4 = ['B', 'A', 'C', 'D', 17] > > # Submitter: Michael Davies > def all_perms(str):

Re: MinGW and Python

2006-04-28 Thread sturlamolden
Ross Ridge wrote: > Links where you can download them were posted in the thread you started > on the MinGW C/C++ forum. AFAIK the links were for various versions of the "VS 2005 redistributable". It does not contain msvcr71.dll, instead it has msvcr80.dll. I don't think there is a download for

popen3 on windows

2006-04-28 Thread John
Hello. Can anyone tell me how to get p.poll() or a workaound to work when using popen3() on windows? I use python 2.3. I am trying to launch a command window to execute a command and then check periodically to see if the command has finished executing. If it has not finished after a given am

Re: best way to determine sequence ordering?

2006-04-28 Thread Steven Bethard
John Salerno wrote: > If I want to make a list of four items, e.g. L = ['C', 'A', 'D', 'B'], > and then figure out if a certain element precedes another element, what > would be the best way to do that? > > Looking at the built-in list functions, I thought I could do something > like: > > if L

convert a int to a list

2006-04-28 Thread Gary Wessle
Hi can type conversion work to convert an int to a list? I am trying to solve an problem in one tutorial. a = ['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]] As an exercise, write a loop that traverses the previou

Re: Converstion

2006-04-28 Thread John Machin
On 29/04/2006 2:22 AM, Edward Elliott wrote: > Peter Otten wrote: >> del x[-1:] # or del x[-1] if you are sure that len(x) > 0 >> just deletes the last item (if any) from x whereas >> x = x[:-1] >> copies all but the last item of the original list into a new one. This can >> take much longer: > >

Re: Can you create an instance of a subclass with an existing instance of the base class?

2006-04-28 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >>Nope. I mean : they don't overuse OO, they overuse *classes*. AFAIK, OO >>means *object* oriented - not class oriented. > > Oh great. Now we have someone re

Re: MinGW and Python

2006-04-28 Thread Ross Ridge
Ross Ridge wrote: > You'd have to point people who don't already have it to Microsoft's > download site. sturlamolden wrote: > Is there a download site? I have not been able to localise one. Links where you can download them were posted in the thread you started on the MinGW C/C++ forum. > 2. yo

Re: Add file to zip, or replace file in zip

2006-04-28 Thread Roger Miller
First note that zipfile is a plain Python module, so reading Python.../Lib/zipfile.py will reveal all its secrets. I don't think it is possible to replace archive members using the module. You could copy all the files into a new zip file, replacing the ones you want to change as you go. But it mig

Re: Non-web-based templating system

2006-04-28 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Thanks, it looks like empy is what I need. :-) -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis The object of war is not to die for your country but to make the other bastard die

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread Kaz Kylheku
Chris Uppal wrote: > Tagore Smith wrote: > > > It's much easier to use a killfile than to complain to an ISP, and I > > think that that should be the preferred response to messages you don't > > like. > > I'm inclined to agree. The problem is not Xah Lee (whom I have killfiled), > but What is t

Re: Using Databases in Python

2006-04-28 Thread Steve Holden
Dennis Lee Bieber wrote: > On 28 Apr 2006 08:20:35 -0700, "Petr Jakes" <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > >>I would like to know if anybody can point me to the site, where it is >>possible to find the tutorial "Using Databases in Python" which is >>mentioned by

Re: best way to determine sequence ordering?

2006-04-28 Thread Edward Elliott
gry@ll.mit.edu wrote: > class Item(object): >def __init__(self, value): > self.val=value > self.order = dict(c=0, a=1, d=2, b=3) >def __cmp__(self, other): > return cmp(self.order[self.val], self.order[other.val]) An object that keeps track of the order it's stored in an

Re: Xah's Edu Corner: What Languages to Hate

2006-04-28 Thread Kaz Kylheku
John Bokma wrote: > Alex Buell <[EMAIL PROTECTED]> wrote: > > > Send your complaints to: > > abuse at sbcglobal dott net > > abuse at dreamhost dott com > > Yup, done. If he's still with dreamhost he probably is in trouble now. If > not, next. Hahaha, right. Your complaints probably go straight do

Re: Undocumented alternate form for %#f ?

2006-04-28 Thread Dave Hughes
Dino Viehland wrote: > I'm assuming this is by-design, but it doesn't appear to be > documented: > > >>> '%8.f' % (-1) > ' -1' > >>> '%#8.f' % (-1) > ' -1.' > > > The docs list the alternate forms, but there isn't one listed for > f/F. It would seem the alternate form for floating po

an error in commented code?

2006-04-28 Thread Sori Schwimmer
That's my output: C wins: ['B', 'D', 'A', 'C'] C wins: ['D', 'B', 'A', 'C'] I'm running Python 2.4.1 under Gentoo Linux. Maybe it's related only to a certain version? Sorin Schwimmer __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam

Re: MinGW and Python

2006-04-28 Thread sturlamolden
Ross Ridge wrote: > You'd have to point people who don't already have it to Microsoft's > download site. Is there a download site? I have not been able to localise one. > I think that having current versions of Python also linked MSVCRT.DLL, > whether compiled with MinGW or MSVC 6, 7 or 8, coul

Re: can i set up a mysql db connection as a class ?

2006-04-28 Thread nephish
way cool, i think that this will work. thanks very much -sk -- http://mail.python.org/mailman/listinfo/python-list

Re: not quite 1252

2006-04-28 Thread Anton Vredegoor
Martin v. Löwis wrote: > So if that is the case: What is the problem then? If you interpret > the document as cp1252, and it contains \x93 and \x94, what is > it that you don't like about that? In yet other words: what actions > are you performing, what are the results you expect to get, and > wha

Re: Somebody report John [was Re: ]

2006-04-28 Thread John Bokma
Ken Tilton <[EMAIL PROTECTED]> wrote: > I love this entire thread. Thank you, Xah! Me too. I hope he posts again soon :-p And good luck with the reporting business ;-) -- John MexIT: http://johnbokma.com/mexit/ personal page: http:

How to align a text of a Listbox to the right

2006-04-28 Thread Sori Schwimmer
Eric Brunel is right in that a Listbox won't provide any builtin help for this kind of things. Suppose you can afford a width of 10 chars. Suppose your lines are stored in the variable Lines - a sequence. Suppose you use a font with fixed width (the width occupied by "i" is the same like for "m").

Re: an error in commented code?

2006-04-28 Thread John Salerno
André wrote: > Tried adding a "\n" (i.e. press the enter key) after the last line > (i.e. right after the word "order") so that you don't end with a > comment. > > André > Weird, but it worked! :) -- http://mail.python.org/mailman/listinfo/python-list

Somebody report John [was Re: ]

2006-04-28 Thread Ken Tilton
John Bokma wrote: > Bill Atkins <[EMAIL PROTECTED]> wrote: > > >>John Bokma <[EMAIL PROTECTED]> writes: >> >>>Isn't it crazy that one person is allowed to create such a huge mess >>>everytime he posts? >> >>Isn't it crazy that one person willfully creates such a mess every >>time Xah posts? S

detect enter key

2006-04-28 Thread david brochu jr
I am writing a script in which I need to wait for the user to press enter before continuing...how would I detect when the user presses the "Enter" key?     Thanks -- http://mail.python.org/mailman/listinfo/python-list

Possible constant assignment operators ":=" and "::=" for Python

2006-04-28 Thread tsaar2003
Hi Pythonians, To begin with I'd like to apologize that I am not very experienced Python programmer so please forgive me if the following text does not make any sense. I have been missing constants in Python language. There are some workarounds available, for example the const-module. To me, this

Re: an error in commented code?

2006-04-28 Thread Lou Losee
Hmmm, runs fine for me:IDLE 1.1.3  >>> RESTART >>> C wins:['B', 'D', 'A', 'C']C wins:['D', 'B', 'A', 'C'] >>> When I pasted your code the last line was 58On 4/28/06, John Salerno <[EMAIL PROTECTED] > wrote:Here's my code, with the

Undocumented alternate form for %#f ?

2006-04-28 Thread Dino Viehland
I'm assuming this is by-design, but it doesn't appear to be documented: >>> '%8.f' % (-1) ' -1' >>> '%#8.f' % (-1) ' -1.' The docs list the alternate forms, but there isn't one listed for f/F. It would seem the alternate form for floating points is truncate & round the floating poin

Re: MinGW and Python

2006-04-28 Thread Ross Ridge
Ross Ridge write: > No one is working on removing MinGW's depency on MSVCRT.DLL. Ames Andreas wrote: > There is certainly work underway to ease the use of msvcrXX in > mingw built binaries. Danny makes it pretty clear in the message you refered that he's not working on that. > 2) legal issues:

Re: an error in commented code?

2006-04-28 Thread André
Tried adding a "\n" (i.e. press the enter key) after the last line (i.e. right after the word "order") so that you don't end with a comment. André -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to determine sequence ordering?

2006-04-28 Thread John Salerno
gry@ll.mit.edu wrote: > index is about the best you can do with the structure you're using. > If you made the "items" instances of a class, then you could define a > __cmp__ member, which would let you do: > > a=Item('A') > b=Item('B') > if a > The Item class could use any of various means to mai

an error in commented code?

2006-04-28 Thread John Salerno
Here's my code, with the error following it: props = ['A', 'B', 'C', 'D'] group1 = ['C', 'A', 'D', 'B', 17] group2 = ['A', 'B', 'D', 'C', 32] group3 = ['D', 'B', 'C', 'A', 34] group4 = ['B', 'A', 'C', 'D', 17] # Submitter: Michael Davies def all_perms(str): if len(str) <=1: yield st

Re:

2006-04-28 Thread John Bokma
Bill Atkins <[EMAIL PROTECTED]> wrote: > John Bokma <[EMAIL PROTECTED]> writes: >> >> Isn't it crazy that one person is allowed to create such a huge mess >> everytime he posts? > > Isn't it crazy that one person willfully creates such a mess every > time Xah posts? Shush! Since you're posting

Re: best way to determine sequence ordering?

2006-04-28 Thread gry
index is about the best you can do with the structure you're using. If you made the "items" instances of a class, then you could define a __cmp__ member, which would let you do: a=Item('A') b=Item('B') if ahttp://mail.python.org/mailman/listinfo/python-list

Re:

2006-04-28 Thread Bill Atkins
John Bokma <[EMAIL PROTECTED]> writes: > > Isn't it crazy that one person is allowed to create such a huge mess > everytime he posts? Isn't it crazy that one person willfully creates such a mess every time Xah posts? Shush! -- This is a song that took me ten years to live and two years to writ

Re: Using Databases in Python

2006-04-28 Thread Petr Jakes
I have got Steven's book of course (it is excellent IMHO). I was just thinking some new approaches can be found in the tutorial. Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Summer of Code mailing list

2006-04-28 Thread Neal Norwitz
There's a new SoC mailing list. [EMAIL PROTECTED] You can sign up here: http://mail.python.org/mailman/listinfo/soc2006 This list is for any SoC discussion: mentors, students, idea, etc. Student can submit applications starting May 1, so now is the time to get students interested in your

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread John Bokma
"Tagore Smith" <[EMAIL PROTECTED]> wrote: > > Chris Uppal wrote: > >> I'm inclined to agree. The problem is not Xah Lee (whom I have >> killfiled), but the people who insist on making my killfile useless >> by posting loads of follow-ups saying things amounting to "stop this >> insane gibberish

Urllib2 / add_password method

2006-04-28 Thread mrstephengross
I'm working on learning how to use urllib2 to use a proxy server. I've looked through the postings on this group, and it's been helpful. I have not, however, found complete documentation on the add_password() functions. Here's what I've got so far: # import

Re: wxPython problem

2006-04-28 Thread scottholdensmith
What I'm wondering is, perhaps it has something to do with the wx.pth file? I can't seem to find anything in the documentation about what the path should be, which file it should be pointing to. Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Awesome PySIG meeting last night

2006-04-28 Thread Ted Roche
On Apr 28, 2006, at 10:31 AM, Ben Scott wrote: > I must say, the level of harrassment was fairly low. I expect a > higher quality of heckling from this group. Don't let it happen > again. Be careful what you wish for! Ted Roche Ted Roche & Associates, LLC http://www.tedroche.com -- http://

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread John Bokma
"Chris Uppal" <[EMAIL PROTECTED]> wrote: > I'm inclined to agree. The problem is not Xah Lee (whom I have > killfiled), but the people who insist on making my killfile useless by > posting loads of follow-ups saying things amounting to "stop this > insane gibberish". Every bloody time. Yup, an

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-28 Thread John Bokma
"Tagore Smith" <[EMAIL PROTECTED]> wrote: > It's much easier to use a killfile than to complain to an ISP, and I > think that that should be the preferred response to messages you don't > like. No, since even if you kill file Xah Lee, he keeps wasting resources of people who have dedicated equip

wxPython, wxcombobox opening

2006-04-28 Thread Rony Steelandt
Hi, Does somebody knows a way to automaticely open the list part of a wxCombobox when it gets the focus ? tia, Rony -- http://mail.python.org/mailman/listinfo/python-list

RE: MinGW and Python

2006-04-28 Thread Ames Andreas
> -Original Message- > From: "Martin v. Löwis" [mailto:[EMAIL PROTECTED] > Sent: Friday, April 28, 2006 6:20 PM > Subject: Re: MinGW and Python > > It all depends on what CRT version you link Python with. If you > use mingw32 to link Python with msvcr71.dll, nothing would change > for pyw

Re: wxPython problem

2006-04-28 Thread scottholdensmith
No, it's python2.4. It says there's no module wx...hmm. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython problem

2006-04-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I'm a little confused. I installed wxPython on my Thinkpad T23, on > which I'm running Fedora Core 5. I did it using Yum and Yumex, and > everything installed fine. In fact, I now have PyShell and PyCrust in > my applications. Within those two apps I can use wx as a modu

Re: Converstion

2006-04-28 Thread Edward Elliott
Peter Otten wrote: > del x[-1:] # or del x[-1] if you are sure that len(x) > 0 > just deletes the last item (if any) from x whereas > x = x[:-1] > copies all but the last item of the original list into a new one. This can > take much longer: But his data is a string, which is immutable but heavily

Re: MinGW and Python

2006-04-28 Thread Martin v. Löwis
Ames Andreas wrote: > There remains one technical issue that isn't a killer but would > be inconvenient, IMHO: Can pywin32 be made working with a > mingw-python (I'm quite sure it can't be made building on it)? > I'd appreciate any datapoints about that ... It all depends on what CRT version you

Re: OOP techniques in Python

2006-04-28 Thread Steven Bethard
Dennis Lee Bieber wrote: > On Thu, 27 Apr 2006 14:32:15 -0500, Philippe Martin > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> What then is the point of the double underscore (if any) ?: > > To prevent masking/shadowing of inherited attributes... Note that it can fa

Re: Using Databases in Python

2006-04-28 Thread BartlebyScrivener
It might be in his book, Python Web Programming, or just go to http://www.holdenweb.com/ and ask him yourself using the contact form. He's a generous contributor here. rick -- http://mail.python.org/mailman/listinfo/python-list

wxPython problem

2006-04-28 Thread scottholdensmith
I'm a little confused. I installed wxPython on my Thinkpad T23, on which I'm running Fedora Core 5. I did it using Yum and Yumex, and everything installed fine. In fact, I now have PyShell and PyCrust in my applications. Within those two apps I can use wx as a module. But from the bash shell, when

Re: os.startfile() - one or two arguments?

2006-04-28 Thread BartlebyScrivener
Neat tutorial. Thank you! Rick -- http://mail.python.org/mailman/listinfo/python-list

Re: How to align the text of a Listbox to the right

2006-04-28 Thread Edward Elliott
Leonardo da Vinci wrote: >> to limit the width to something acceptable, and show >> only the tail of the line. > > Yes, this is exactly what I wanted to do. Do you know a way to > accomplish that? Because Eric Brunel said it is impossible on a > Listbox. Use a string slice. -- http://mail.pytho

Re: Converstion

2006-04-28 Thread Peter Otten
Paddy wrote: > the del version - is that an optimisation? > Is it actually faster? del x[-1:] # or del x[-1] if you are sure that len(x) > 0 just deletes the last item (if any) from x whereas x = x[:-1] copies all but the last item of the original list into a new one. This can take much longer

Re: MS VC++ Toolkit 2003, where?

2006-04-28 Thread Chris Mellon
On 27 Apr 2006 12:06:44 -0700, sturlamolden <[EMAIL PROTECTED]> wrote: > > Alex Martelli wrote: > > > Provides the core msvcrt.lib for msvcr71.dll against which to link > > your extensions. This is critically important, as without it you are > > going to wind up linking against the wrong run

Re: Editing a function in-memory and in-place

2006-04-28 Thread Ian Bicking
Thanks for the answers, very helpful. I think I'm going to give Peter's hack a try, as it's actually quite close to what I'm trying to do -- I get the source for the new function, then that lets me make the old function become the new one. But I'll probably also use Michael's solution for class e

Re: os.startfile() - one or two arguments?

2006-04-28 Thread BartlebyScrivener
Whoops! Sorry all. I was using the "in-development" version of the documentation and didn't even realize it. Thank you, Rick -- http://mail.python.org/mailman/listinfo/python-list

Re: Converstion

2006-04-28 Thread Paddy
the del version - is that an optimisation? Is it actually faster? - I did not have enough info. to check so just did what came naturally to me :-) - Pad. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >