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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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").
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:
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
way cool, i think that this will work.
thanks very much
-sk
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
[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
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
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
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
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:
>
>
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
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
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
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
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):
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
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:
"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.
>
"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
Could someone tell me the easiest way to create a GUI slider control in
Python?
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
Anyone know where to get the iputils module for python?
--
http://mail.python.org/mailman/listinfo/python-list
> 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:
>
> 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?
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
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
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,
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
"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
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
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
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
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
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
"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
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
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
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
>
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
"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
[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
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
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
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
[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
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
>>
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
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-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-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
=
---
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
"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,
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
[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
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
101 - 177 of 177 matches
Mail list logo