> From: Tommy Grav
>
> Hi everyone,
>
>I have a list of objects where I have want to do two loops.
> I want to loop over the list and inside this loop, work on all
> the elements of the list after the one being handled in the outer
> loop. I can of course do this with indexes:
>
> >>> alist
> -Original Message-
> From: Kevin Walzer
>
> See
http://www.codebykevin.com/blosxom/business/phynchronicity-new.png:
> this is an application I develop. The layout is all handled by "pack"
> and paned windows. Where you you use "grid" in a layout like this?
>
I'd use a three row grid, w
> From: thebjorn
> What's stabledict? I'm assuming that ordereddict is a mapping that
> maintains insertion order(?)
Yes, ordereddict is a dict that maintains insertion order. Stabledict
is probably a dict that maintains _an_ order, so that repr() and the
like return the same value when used on d
> From: Paul Hankin
>
>
> Here's a first go. Sorting occurs when the keys are iterated over,
> making it fast (almost as a dict) for construction, insertion, and
> deletion, but slow if you're iterating a lot. You should look at some
> use cases to decide if this approach is best, or if a sorted
> From: Michele Simionato
>
> On Sep 12, 3:54 pm, Mark Summerfield <[EMAIL PROTECTED]>
> wrote:
> > On 12 Sep, 13:46, Michele Simionato <[EMAIL PROTECTED]>
> >
> > Actually I meant by key order, so insertion order doesn't matter at
> > all. If you need a dictionary-like data structure that respect
> From: madzientist
>
> Thanks, everybody, for the very very useful and kind responses.
>
> There is a second reason why I asked the question about automatic de-
> indenting. I am teaching myself Python partly so I can then help my
> technically astute, but blind friend learn programming. For the
> From: Chris
>
> I have a python script that is driving Excel and using the win32com
> module. However, upon program completion there's still an Excel.exe
> process running in the background that I must terminate through Task
> Manager. Reading up on other threads indicate that maybe I still have
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of
> [EMAIL PROTECTED]
> Sent: Tuesday, September 11, 2007 8:26 AM
> To: python-list@python.org
> Subject: Re: newbie: stani's python editor if-else
>
> On Sep 10, 11:24 pm, madzientist <[EMAIL PRO
> From: Steve Holden
> Neil Cerutti wrote:
> > On 2007-09-10, Chris Mellon <[EMAIL PROTECTED]> wrote:
> >> On 9/10/07, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> >>> Agreed; but I prefer 'if y[0] == ""', absent more context and
> >>> better names.
> >> Probably should use u"" if you're going to take
> From: Chris
>
> I'm trying to create an excel file which will act as a log, however I
> want to overwrite the file if it exists.
>
> Looking at the SaveAs method I can't find anything that would allow
> it. I don't want the prompt to appear to ask whether to replace the
> file or not. I just wa
> From: imageguy
>
> We are trying to implement a system that checks the version of the
> application against a version number stored in the database. We don't
> want the app and the db don't become out of sync.
>
> We have tried setting a __version__ variable in the top most module,
> however,
> From: [EMAIL PROTECTED]
> >
> > How could it not be an exception, in the plain English sense of the
> > word? Most certainly you're asking for the index because you want to
do
> > something with the index. If the item is not found, you have no
index,
> > so that's a special case that must be hand
> From: Lee Fleming
> On Aug 6, 12:30 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote:
> > When you call f(23), the variable y within it gets created and
points at
> > None. When f(23) exits, the y that it created gets destroyed.
(Well,
> > goes ou
> From: Lee Fleming
>
> On Aug 6, 6:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> Because when the function is called, the line
>
>
> > if y is None: y = []
>
>
> is executed, binding a brand new empty list to y. This
> "rebinding" happens every time the function is called, unless you
> From: Joshua J. Kugler
>
> I am getting results like these with the time module:
>
> >>> import time
> >>> int(time.mktime(time.strptime('2007-03-11 02:00:00', '%Y-%m-%d
%H:%M
> %S')))
> 1173610800
> >>> int(time.mktime(time.strptime('2007-03-11 03:00:00', '%Y-%m-%d
%H:%M
> %S')))
> 1173610800
> From: Jim
> Hi,
> I'm looking at page 548 of Programming Python (3rd Edition) by Mark
> Lutz.
> The following GUI script works with no problem, i.e., the rows and
> columns expand:
> =
> # Gridded Widgets Expandable page 548
>
> fro
> From: Paul Rubin
>
> greg <[EMAIL PROTECTED]> writes:
> > > E.g. your program might pass its test and run properly for years
> > > before some weird piece of input data causes some regexp to not
quite
> > > work.
> >
> > Then you get a bug report, you fix it, and you add a test
> > for it so tha
> From: walterbyrd
>
>
> Yes, but those languages also have the notion of structures that do
> not allow arbitrary collections. That is what I was wondering about
> when I started the thread. It's fine that python has four different
> ways of creating collections of arbitrary data types, but I th
I'm in need of a module that will let me create Excel workbooks from within
Python. Something like PyExcelerator, but it needs to work with Python 2.3.
(A third-party limitation that I have no control over.) Can anyone point me
to what I need? All my searches keep leading back to PyExcelerator.
> From: Warren Stringer
> Hmmm, this is for neither programmer nor computer; this is for a user. If
> I
> wanted to write code for the benefit for the computer, I'd still be
> flipping
> switches on a PDP-8. ;-)
>
> This is inconsistent:
>
> why does c[:][0]() work but c[:]() does not?
> Why does
> From: king kikapu
>
> Hi,
>
> i have a problem with the following piece of code that id just drive
> me nuts (from the morning...)
> I think is more Python specific than Qt, folks from Qt forum have
> already give me directions of how to do it but that Python error
> message is just impossible
> From: John Machin
> On 21/05/2007 11:30 PM, Konrad Hinsen wrote:
> > I am trying to install Python from sources in my home directory on a Mac
> > cluster (running MacOS X 10.4.8). The path to my home directory contains
> > a blank, and since the installation procedure insists on getting an
> > ab
> From: Tartifola
> Hi,
> I have a list with probabilities as elements
>
> [p1,p2,p3]
>
> with of course p1+p2+p3=1. I'd like to draw a
> random element from this list, based on the probabilities contained in
> the list itself, and return its index.
>
> Any help on the best way to do that?
> Tha
> From: Eric Brunel
On Thu, 17 May 2007 09:30:57 +0200, Hendrik van Rooyen
> <[EMAIL PROTECTED]> wrote:
> > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> >> En Wed, 16 May 2007 03:22:17 -0300, Hendrik van Rooyen
> >>> I have never seen this working in Tkinter, unless the button was
> >>> presse
> From: [EMAIL PROTECTED]
>
> Hi,
> When I call tkFileDialog.askopenfilename() , the dialog box opens with
> the current directory as the default directory. Is it possible to open
> the dialog box with a directory other than the current directory. Can
> we pass in a user defined starting director
> From: Beliavsky
On May 15, 1:30 am, Anthony Irwin <[EMAIL PROTECTED]> wrote:
>
>
>
> > #5 someone said that they used to use python but stopped because the
> > language changed or made stuff depreciated (I can fully remember
> > which) and old code stopped working. Is code written today likely
> From: [EMAIL PROTECTED]
> F:\Ohjelmat\Python25\Lib\keyword.pyc
That's your problem. Rename keyword.py to keywordcheck.py, and delete
keyword.pyc in this directory, and it should work fine.
---
-Bill Hamilton
--
http://mail.python.org/mailman/listinfo/python-list
> From: [EMAIL PROTECTED]
>
> Hi
>
> I try to check whether a given input is keyword or not. However this
> script won't identify keyword input as a keyword. How should I modify it
> to make it work?
>
> #!usr/bin/env python
> import keyword
>
> input = raw_input('Enter identifier to check >> '
> From: Alan Isaac
>
> I'm sure my first pass will be flawed, but here goes:
>
> http://docs.python.org/lib/typesmapping.html:
> to footnote (3), add phrase "which may depend on the memory location of
> the
> keys" to get:
>
> Keys and values are listed in an arbitrary order,
> which may
> From: Bjoern Schliessmann
> Sounds more familiar than the analog approach. Maybe I misunderstood
> something ... but I can't transfer my problem to this way of
> thinking yet. My biggest problem is the fact that relays aren't
> really interested in voltage, but current.
>
> Also, I find it diffi
> From: Chris
> > I'll admit to being surprised at seeing a claim that a
tkinter
> > application, started within an interactive session, without a
mainloop,
> > even runs... I could see it maybe happening from Idle, since Idle is
> > running a tkinter mainloop, so the application bindings m
> -Original Message-
> From: [EMAIL PROTECTED]
>
> On May 4, 5:02 am, Jaswant <[EMAIL PROTECTED]> wrote:
> > This is a simple way to do it i think
> >
> > s=hello
> >
> > >>> if(len(s)==0):
> >
> > ... print "Empty"
> > ... else:
> > ... print s
> > ...
> > hello
>
> But you are
> -Original Message-
> From: Chris
> Subject: Re: Strange terminal behavior after quitting Tkinter
application
> Clicking 'Quit' or on the window's 'x' causes the application to quit
> without messing up the terminal. With root.mainloop() commented out,
> though, no combination of root.quit
> -Original Message-
> From: Steven D'Aprano
> Sent: Monday, April 30, 2007 10:14 PM
> To: python-list@python.org
> Subject: RE: Dict Copy & Compare
>
> On Mon, 30 Apr 2007 12:50:58 -0500, Hamilton, William wrote:
>
> >> On quick question, h
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of John Nagle
> Sent: Monday, April 30, 2007 7:32 PM
> To: python-list@python.org
> Subject: Re: re-importing modules
>
> [EMAIL PROTECTED] wrote:
>
> >>In addition to the warning that reload() do
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of Robert
Rawlins -
> Think Blue
> Sent: Monday, April 30, 2007 6:09 AM
> To: 'Tim Golden'
> Cc: python-list@python.org
> Subject: RE: Dict Copy & Compare
>
> On quick question, how can I order a d
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of spohle
> Sent: Monday, April 30, 2007 10:25 AM
> To: python-list@python.org
> Subject: Re: import structures
>
> On Apr 30, 8:16 am, "Hamilton, William " <
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of spohle
> Sent: Monday, April 30, 2007 10:03 AM
> To: python-list@python.org
> Subject: Re: import structures
>
> On Apr 30, 8:00 am, Paul McGuire <[EMAIL PROTECTED]> wrote:
> > On Apr 30, 9:56 a
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of gtb
> Sent: Thursday, April 26, 2007 1:50 PM
> To: python-list@python.org
> Subject: Re: Python keywords
>
> On Apr 26, 10:16 am, Larry Bates <[EMAIL PROTECTED]> wrote:
> > http://docs.python.or
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of Antoon
Pardon
> Sent: Tuesday, April 24, 2007 7:40 AM
> To: python-list@python.org
> Subject: Re: Tutorial creates confusion about slices
>
> On 2007-04-24, Michael Bentley <[EMAIL PROTECTED]> w
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of Antoon
Pardon
> Sent: Monday, April 23, 2007 7:38 AM
> To: python-list@python.org
> Subject: Tutorial creates confusion about slices
>
> The following is part of the explanation on slices in the
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of wswilson
> Sent: Wednesday, April 18, 2007 1:39 PM
> To: python-list@python.org
> Subject: Iterate through a dictionary of lists one "line" at a time
>
> Here is my code:
>
> listing = {'id': [
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of Chris Mellon
> Sent: Wednesday, April 11, 2007 9:12 AM
> To: python-list@python.org
> Subject: Re: tuples, index method, Python's design
>
>
> So, when you have a) a third party module that you c
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of Scott
>
> I understand all that. What I don't understand is why all the
> documentation
> I see says, "When removing a specific element from a list using pop()
it
> must be in this format: list
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of wswilson
> Sent: Wednesday, April 11, 2007 9:24 AM
> To: python-list@python.org
> Subject: passing class by reference does not work??
>
> Here is my code:
>
> class A():
> val = 0
>
> de
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of Steven
D'Aprano
> Sent: Wednesday, April 11, 2007 7:49 AM
> To: python-list@python.org
> Subject: Re: tuples, index method, Python's design
>
> (There is one other option: you care that 32 is so
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Manuel Graune
Sent: Thursday, April 05, 2007 12:14 PM
To: python-list@python.org
Subject: Objects, lists and assigning values
Hello,
while trying to learn how to program using objects in python (up to now
s
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, April 05, 2007 1:01 PM
To: python-list@python.org
Subject: Looping issues
What I am trying to do is compare two files to each other.
If the 2nd file contains the same line t
I apologize for bringing up something that's a month dead. But, I've
been reading through the recent archives and came across this
discussion, and want to make sure I understand a particular about the
interactive prompt.
"Martin Unsal" wrote:
> I'm perfectly well aware that I'm not going to be a
49 matches
Mail list logo