[Tutor] List installed python modules

2008-07-21 Thread Eli Brosh
Hello, Is there a way to get a list of installed python modules and their versions ? i.e. I would like to know if matplotlib is installed on my computer and what version is it. And so with other modules. Thanks Eli ___ Tutor maillist - Tutor@python.o

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Norman Khine
Alan Gauld wrote: "Norman Khine" <[EMAIL PROTECTED]> wrote Frankly I'd use a database. Just load the data into it using Python. Then execute SQL querioes to get the counts etc. Not really an option to use SQL just for this. I'm curious why? It seems to suggest that using SQL is somehow a

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Kent Johnson
On Tue, Jul 1, 2008 at 7:03 AM, Norman Khine <[EMAIL PROTECTED]> wrote: > Kent Johnson wrote: >> for first in x: >> for second in y: >>if first and second and (first, second) in table: > > I don't really see this clearly as I may have n'th values for 'x' and n'th > values for 'y' so I will nee

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Alan Gauld
"Norman Khine" <[EMAIL PROTECTED]> wrote Frankly I'd use a database. Just load the data into it using Python. Then execute SQL querioes to get the counts etc. Not really an option to use SQL just for this. I'm curious why? It seems to suggest that using SQL is somehow a big deal? But with

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Kent Johnson
On Tue, Jul 1, 2008 at 6:27 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > "Kent Johnson" <[EMAIL PROTECTED]> wrote >>> >>> if isinstance(x, list): >>> for item in x: >>> x = item >> >> This just assigns x to the last element of the list > > Oops, yes, I said

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Norman Khine
Kent Johnson wrote: On Tue, Jul 1, 2008 at 3:09 AM, Norman Khine <[EMAIL PROTECTED]> wrote: x = getattr(brain, horizontal) if isinstance(x, list): for item in x: x = item This just assigns x to the last element of the list, it doesn't

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Norman Khine
Hi, Alan Gauld wrote: "Norman Khine" <[EMAIL PROTECTED]> wrote Here is the 'full' code as such which gets the data from the files. Unfortunately trying to read this is still difficult since we don't know what the structure of x, horizontal_criterias, vertical_criterias, or brains is like.

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote if isinstance(x, list): for item in x: x = item This just assigns x to the last element of the list Oops, yes, I said the first but in fact reassigning x does not stop the loop, it seems the loop works on a

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Kent Johnson
On Tue, Jul 1, 2008 at 3:09 AM, Norman Khine <[EMAIL PROTECTED]> wrote: >x = getattr(brain, horizontal) >if isinstance(x, list): >for item in x: >x = item This just assigns x to the last element of the list, it doesn't process the whole

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Alan Gauld
"Norman Khine" <[EMAIL PROTECTED]> wrote Here is the 'full' code as such which gets the data from the files. Unfortunately trying to read this is still difficult since we don't know what the structure of x, horizontal_criterias, vertical_criterias, or brains is like. ## Classify t

Re: [Tutor] list objects are unhashable

2008-07-01 Thread Norman Khine
Hi, Here is the 'full' code as such which gets the data from the files. ## Classify the users table = {} table[('', '')] = 0 for x in horizontal_criterias: table[(x['id'], '')] = 0 for y in vertical_criterias: table[('', y['id'])] =

Re: [Tutor] list objects are unhashable

2008-06-30 Thread Martin Walsh
Hi Norman, Norman Khine wrote: > > for brain in brains: > x = getattr(brain, horizontal) > x = string.join(x, '' ) > y = getattr(brain, vertical) > y = string.join(y, '' ) > if x and y and (x, y) in table: > table

Re: [Tutor] list objects are unhashable

2008-06-30 Thread Norman Khine
Hi, Sorry, but this did not work. I have done this, which returns the values I want (sort of) for brain in brains: x = getattr(brain, horizontal) if isinstance(x, list): for item in x: x = item else:

Re: [Tutor] list objects are unhashable

2008-06-30 Thread Alan Gauld
"Norman Khine" <[EMAIL PROTECTED]> wrote but when I run this, I get the following error on the line: if x and y and (x, y) in table: TypeError: list objects are unhashable Please post the entire error. The tiny bit you posted was not overly helpful, usually the stacjk trace contains the ac

Re: [Tutor] list objects are unhashable

2008-06-30 Thread Cédric Lucantis
Le Monday 30 June 2008 21:31:35, vous avez écrit : > Thanks, > but where do i replace the x with tuple(x) > Whenever x is hashed, ie used as a key in a dictionary. You said you have: > >> table[(x, y)] += 1 > >> where: > >> > >> x = ['airlines-scheduled', 'airport-car-parking']

Re: [Tutor] list objects are unhashable

2008-06-30 Thread Norman Khine
Thanks, but where do i replace the x with tuple(x) Norman Cédric Lucantis wrote: Le Monday 30 June 2008 20:55:36 Norman Khine, vous avez écrit : Hello, I would like to count list items but am not 100% sure how to do it. Here is what I have so far: for brain in brains:

Re: [Tutor] list objects are unhashable

2008-06-30 Thread Cédric Lucantis
Le Monday 30 June 2008 20:55:36 Norman Khine, vous avez écrit : > Hello, > > I would like to count list items but am not 100% sure how to do it. > > Here is what I have so far: > > for brain in brains: > x = getattr(brain, horizontal) > y = getattr(brain, vertical

[Tutor] list objects are unhashable

2008-06-30 Thread Norman Khine
Hello, I would like to count list items but am not 100% sure how to do it. Here is what I have so far: for brain in brains: x = getattr(brain, horizontal) y = getattr(brain, vertical) if x and y and (x, y) in table: table[(x, y)] += 1

Re: [Tutor] tutor list equivalent for lisp?

2008-06-05 Thread Danny Yoo
But i only play with Lisp these days so am well out of date. The best Lisp tutorial IMHO is the How To Design Programs web site/book (htdp.org?) Yes, HTDP is one of the very good ones. I'd strongly recommend it. As a full disclosure thing: I'm involved with the folks doing HTDP: I'm not a n

Re: [Tutor] tutor list equivalent for lisp?

2008-06-05 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote Well, my desire to extend emacs has made me want to get more serious about it. The emacs community is pretty good for supporting elispers but I don't know of any tutor style lists. ( So far as I know this list is fairly unique! There is something like it for PHP b

[Tutor] OT: tutor list equivalent for lisp?

2008-06-05 Thread broek
Hi all, I've an off-topic query; hope no one minds. I've poked into the lisp world a bit before (started SICP, etc., but never used it in anger), and put it on my `when I've more time' shelf. Well, my desire to extend emacs has made me want to get more serious about it. Does anyone kno

Re: [Tutor] list and tuple question

2008-05-04 Thread Alan Gauld
"quantrum75" <[EMAIL PROTECTED]> wrote in Hi everybody Hi, I think the key to your question is here: a=((1,),(2,),(3,),(4,),(5,)) I need the comma since it is going into an excel sheet. I think you are confused between tuples and comma separated strings - which is what yo

[Tutor] List and tuple question -resend #2

2008-05-04 Thread quantrum75
Sincerely sorry for spamming everybody. Dint know about yahoo's quirks regarding html attachments.. Hopefully this works. Hi everybody I have a simple newbie kind of questions. I have tried hard to solve it, but couldn't figure it out. The problem is, I want to make a tuple of tuples or a list o

[Tutor] List and tuple question -resend

2008-05-04 Thread quantrum75
Hi everybodyI have a simple newbie kind of questions. I have tried hard to solve it, but couldn't figure it out.The problem is,I want to make a tuple of tuples or a list of lists in a iterative fashion in the following format. For example,a=[[1,],[2,],[3,],[4,],[5,]]or a=((1,),(2,),(3,),(4,),(5,))I

[Tutor] list and tuple question

2008-05-04 Thread quantrum75
Hi everybodyI have a simple newbie kind of questions. I have tried hard to solve it, but couldn't figure it out.The problem is,I want to make a tuple of tuples or a list of lists in a iterative fashion in the following format. For example,a=[[1,],[2,],[3,],[4,],[5,]]or a=((1,),(2,),(3,),(4,),(5,))I

Re: [Tutor] List comprehensions

2008-04-10 Thread bob gailer
ith a built-in > would help. Maybe not? > > Hope that helps. > > Dinesh > > > - Original Message - > *From:* Kent Johnson <mailto:[EMAIL PROTECTED]> > *To:* Dinesh B Vadhia <mailto:[EMAIL PROTECTED]> > *Cc:* tutor@python.org <mail

Re: [Tutor] List comprehensions

2008-04-10 Thread Kent Johnson
Alan Gauld wrote: > One possibility is that the javascript fetches the list back on the > first few characters and caches it on the browser Here is an autocomplete widget I use that can do exactly that: http://www.dyve.net/jquery/?autocomplete Kent ___

Re: [Tutor] List comprehensions

2008-04-10 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote >> application/service. Each time a user inputs a character, the >> character >> is sent to the backend Python program which searches for the >> character >> in a list of >10,000 string items. Once it finds the character, >> the >> backend will return

Re: [Tutor] List comprehensions

2008-04-10 Thread Kent Johnson
Dinesh B Vadhia wrote: > Kent > > I'm using a Javascript autocomplete plugin for an online web > application/service. Each time a user inputs a character, the character > is sent to the backend Python program which searches for the character > in a list of >10,000 string items. Once it finds

Re: [Tutor] List comprehensions

2008-04-10 Thread W W
My guess, though I'm not sure, is that google uses hashes... why? Because they're a *ahem* load faster than loops, and the reason is they replace the repetitive nature of a loop by using some type of formula. Exactly /how/ this is implemented, I'm not sure. A simple example of the speed differenc

Re: [Tutor] List comprehensions

2008-04-10 Thread linuxian iandsd
i think you are using ajax ... which undoubdetly uses an sql database since its based on queries run from whithin the application in the browser whithout the need for refreshing the page ... i would suggest you try serching internet for something like "google autocomplete feature" & i guess the qu

Re: [Tutor] List comprehensions

2008-04-10 Thread linuxian iandsd
also if you need to go for 2 results I propose you use filters & interactive menus which will help you tailor the query to the users desires & thus limit the query results. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinf

Re: [Tutor] List comprehensions

2008-04-10 Thread Alan Gauld
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote i > I'm using a Javascript autocomplete plugin for an online > web application/service. Each time a user inputs a character, > the character is sent to the backend Python program which > searches for the character in a list of >10,000 string items.

Re: [Tutor] List comprehensions

2008-04-09 Thread Dinesh B Vadhia
ed sensible that replacing the for loop with a built-in would help. Maybe not? Hope that helps. Dinesh - Original Message - From: Kent Johnson To: Dinesh B Vadhia Cc: tutor@python.org Sent: Wednesday, April 09, 2008 1:48 PM Subject: Re: [Tutor] List comprehensions Dinesh B Vadhia wr

Re: [Tutor] List comprehensions

2008-04-09 Thread Jerry Hill
On Wed, Apr 9, 2008 at 4:48 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > You could use > [ sys.stdout.write(some operation on item) for item in data ] > > but I consider this bad style and I seriously doubt you will see any > difference in performance. This really isn't a good idea. It will

Re: [Tutor] List comprehensions

2008-04-09 Thread Jerry Hill
On Wed, Apr 9, 2008 at 4:15 PM, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > Sorry, let's start again. This version really isn't any more helpful than the first one. I know you corrected the sample code, but you haven't addressed any of the fundamental questions that Kent or I asked. > I want to

Re: [Tutor] List comprehensions

2008-04-09 Thread Kent Johnson
Dinesh B Vadhia wrote: > Here is a for loop operating on a list of string items: > > data = ["string 1", "string 2", "string 3", "string 4", "string 5", > "string 6", "string 7", "string 8", "string 9", "string 10", "string 11"] > > result = "" > for item in data: > result = item > pr

Re: [Tutor] List comprehensions

2008-04-09 Thread linuxian iandsd
a potentially better structure preferably a built-in. > > Hope this makes sense! Thank-you. > > Dinesh > > > > - Original Message - *From:* Kent Johnson <[EMAIL PROTECTED]> > *To:* Dinesh B Vadhia <[EMAIL PROTECTED]> > *Cc:* tutor@python.org > *Sent:

Re: [Tutor] List comprehensions

2008-04-09 Thread Dinesh B Vadhia
l Message ----- From: Kent Johnson To: Dinesh B Vadhia Cc: tutor@python.org Sent: Wednesday, April 09, 2008 12:40 PM Subject: Re: [Tutor] List comprehensions Dinesh B Vadhia wrote: > Here is a for loop operating on a list of string items: > > data = ["string 1", "str

Re: [Tutor] List comprehensions

2008-04-09 Thread linuxian iandsd
On Wed, Apr 9, 2008 at 7:44 PM, Jerry Hill <[EMAIL PROTECTED]> wrote: > On Wed, Apr 9, 2008 at 7:12 AM, Dinesh B Vadhia > <[EMAIL PROTECTED]> wrote: > > I want to replace the for loop with a List Comrehension (or whatever) to > > improve performance (as the data list will be >10,000]. At each sta

Re: [Tutor] List comprehensions

2008-04-09 Thread Jerry Hill
On Wed, Apr 9, 2008 at 7:12 AM, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > I want to replace the for loop with a List Comrehension (or whatever) to > improve performance (as the data list will be >10,000]. At each stage of > the for loop I want to print the result ie. List comprehensions are fo

Re: [Tutor] List comprehensions

2008-04-09 Thread Kent Johnson
Dinesh B Vadhia wrote: > Here is a for loop operating on a list of string items: > > data = ["string 1", "string 2", "string 3", "string 4", "string 5", > "string 6", "string 7", "string 8", "string 9", "string 10", "string 11"] > > result = "" > for item in data: > result = item + "\n" >

[Tutor] List comprehensions

2008-04-09 Thread Dinesh B Vadhia
Here is a for loop operating on a list of string items: data = ["string 1", "string 2", "string 3", "string 4", "string 5", "string 6", "string 7", "string 8", "string 9", "string 10", "string 11"] result = "" for item in data: result = item + "\n" print result I want to replace the for loo

Re: [Tutor] list

2008-03-21 Thread Steve Willoughby
elis aeris wrote: > arra = [0] * 10 ? If you want a list of ten zeroes, yes. A couple of suggestions: Find a tutorial introduction to Python such as those on python.org, or google for "dive into python", and go through the examples in there. Also, use the interactive Python interpreter to try o

Re: [Tutor] list

2008-03-21 Thread elis aeris
arra = [0] * 10 ? On Fri, Mar 21, 2008 at 5:29 PM, Andreas Kostyrka <[EMAIL PROTECTED]> wrote: > Empty? > > array = [] > > If you want to assign 10 "None", that would be: > > array = [None] * 10 > > Andreas > > Am Freitag, den 21.03.2008, 17:03 -0700 schrieb elis aeris: > > how do I create an emp

Re: [Tutor] list

2008-03-21 Thread Andreas Kostyrka
Empty? array = [] If you want to assign 10 "None", that would be: array = [None] * 10 Andreas Am Freitag, den 21.03.2008, 17:03 -0700 schrieb elis aeris: > how do I create an empy int array of 10? > ___ > Tutor maillist - Tutor@python.org > http://

[Tutor] list

2008-03-21 Thread elis aeris
how do I create an empy int array of 10? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List Box for Web

2008-02-26 Thread Luciano Ramalho
On Wed, Feb 27, 2008 at 2:21 AM, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > For my web application, I need a list box with a search capability. An > example is the Python documentation (hit the F1 key under Windows from IDLE) > and specifically the Index list ie. context-sensitive search through

[Tutor] List Box for Web

2008-02-26 Thread Dinesh B Vadhia
I know this isn't the right forum to ask but I'll try as someone might know. For my web application, I need a list box with a search capability. An example is the Python documentation (hit the F1 key under Windows from IDLE) and specifically the Index list ie. context-sensitive search through a

Re: [Tutor] the tutor list has been strangely silent for a few days. Anyone know

2008-01-17 Thread Dick Moores
At 06:41 PM 1/17/2008, bill.wu wrote: >the tutor list has been strangely silent for a few days. Anyone know >what has happened? why? FYI I see 34 messages in my Eudora Tutor mailbox, dated 1/16 Pacific Time (Eudora converts the datetimes to my time zone, PT). Here's a screens

Re: [Tutor] the tutor list has been strangely silent for a few days. Anyone know

2008-01-17 Thread Luke Paireepinart
bill.wu wrote: > the tutor list has been strangely silent for a few days. Anyone know > what has happened? why? I got about 20 e-mails from the list yesterday. Do you consider this slient? or do you maybe have a problem receiving me

[Tutor] the tutor list has been strangely silent for a few days. Anyone know

2008-01-17 Thread bill.wu
the tutor list has been strangely silent for a few days. Anyone know what has happened? why? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List processing question - consolidating duplicate entries

2007-11-29 Thread Kent Johnson
Richard Querin wrote: > import itertools, operator > for k, g in itertools.groupby(sorted(data), key=operator.itemgetter(0, > 1, 2, 3)): > print k, sum(item[4] for item in g) > > > > I'm trying to understand what's going on in the for statement but I'm > having troubles. The i

Re: [Tutor] List processing question - consolidating duplicate entries

2007-11-29 Thread Richard Querin
On Nov 27, 2007 5:40 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > > This is a two-liner using itertools.groupby() and operator.itemgetter: > > data = [['Bob', '07129', 'projectA', '4001',5], > ['Bob', '07129', 'projectA', '5001',2], > ['Bob', '07101', 'projectB', '4001',1], > ['Bob', '07140', 'pr

Re: [Tutor] List processing question - consolidating duplicate entries

2007-11-28 Thread Kent Johnson
Michael Langford wrote: > What you want is a set of entries. Not really; he wants to aggregate entries. > # remove duplicate entries > # > # myEntries is a list of lists, > #such as [[1,2,3],[1,2,"foo"],[1,2,3]] > # > s=set() > [s.add(tuple(x)) for x in myEntries] A set can be constructed d

Re: [Tutor] List processing question - consolidating duplicateentries

2007-11-28 Thread Tiger12506
> s=set() > [s.add(tuple(x)) for x in myEntries] > myEntries = [list(x) for x in list(s)] This could be written more concisely as... s = set(tuple(x) for x in myEntries) myEntries = [list(x) for x in list(s)] Generator expressions are really cool. Not what the OP asked for exactly. He wanted to

Re: [Tutor] List processing question - consolidating duplicate entries

2007-11-27 Thread Michael Langford
What you want is a set of entries. Unfortunately, python lists are not "hashable" which means you have to convert them to something hashable before you can use the python set datatype. What you'd like to do is add each to a set while converting them to a tuple, then convert them back out of the se

Re: [Tutor] List processing question - consolidating duplicate entries

2007-11-27 Thread Kent Johnson
bob gailer wrote: > 2 - Sort the list. Create a new list with an entry for the first name, > project, workcode. Step thru the list. Each time the name, project, > workcode is the same, accumulate hours. When any of those change, create > a list entry for the next name, project, workcode and agai

Re: [Tutor] List processing question - consolidating duplicate entries

2007-11-27 Thread bob gailer
Richard Querin wrote: > I'm trying to process a list and I'm stuck. Hopefully someone can help > me out here: > > I've got a list that is formatted as follows: > [Name,job#,jobname,workcode,hours] > > An example might be: > > [Bob,07129,projectA,4001,5] > [Bob,07129,projectA,5001,2] > [Bob,07101,pr

Re: [Tutor] List processing question - consolidating duplicate entries

2007-11-27 Thread John Fouhy
On 28/11/2007, Richard Querin <[EMAIL PROTECTED]> wrote: > I've got a list that is formatted as follows: > [Name,job#,jobname,workcode,hours] [...] > Now I'd like to consolidate entries that are duplicates. Duplicates > meaning entries that share the same Name, job#, jobname and workcode. > So for

[Tutor] List processing question - consolidating duplicate entries

2007-11-27 Thread Richard Querin
I'm trying to process a list and I'm stuck. Hopefully someone can help me out here: I've got a list that is formatted as follows: [Name,job#,jobname,workcode,hours] An example might be: [Bob,07129,projectA,4001,5] [Bob,07129,projectA,5001,2] [Bob,07101,projectB,4001,1] [Bob,07140,projectC,3001,3

Re: [Tutor] List comp question

2007-11-03 Thread Ricardo Aráoz
Eric Brunson wrote: > Ricardo Aráoz wrote: >> Kent Johnson wrote: >> >>> I am building a list like this: >>> >>> tree = [] >>> for top in tops: >>> l2 = level2(top) >>> if l2: >>> tree.append((top, l2)) >>> >>> I would really like to turn this into a list

Re: [Tutor] List comp question

2007-11-03 Thread Eric Brunson
Ricardo Aráoz wrote: > Kent Johnson wrote: > >> I am building a list like this: >> >> tree = [] >> for top in tops: >> l2 = level2(top) >> if l2: >> tree.append((top, l2)) >> >> I would really like to turn this into a list comprehension: >> >> tree = [ (t

Re: [Tutor] List comp question

2007-11-03 Thread Michael Langford
I decided you probably should also have a cleanup function since garbage collection won't work now unless you explicitly clean the function. This approach works, and also works if you call the function again after you've called cleanup (it just runs the function 1 more time, then again, returns the

Re: [Tutor] List comp question

2007-11-02 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote > I would really like to turn this into a list comprehension: > > tree = [ (top, level2(top)) for top in tops if level2(top) ] > > but the call to level2() is expensive enough that I don't want to > repeat > it. Is there any way to do this or am I stuck w

Re: [Tutor] List comp question

2007-11-02 Thread Ricardo Aráoz
Kent Johnson wrote: > I am building a list like this: > > tree = [] > for top in tops: > l2 = level2(top) > if l2: > tree.append((top, l2)) > > I would really like to turn this into a list comprehension: > > tree = [ (top, level2(top)) for top in tops if

Re: [Tutor] List comp question

2007-11-02 Thread Michael Langford
Decorate level2 with a decorator that caches: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/425445 --Michael On 11/1/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > I am building a list like this: > > tree = [] > for top in tops: > l2 = level2(top) > if

[Tutor] List comp question

2007-11-02 Thread Kent Johnson
I am building a list like this: tree = [] for top in tops: l2 = level2(top) if l2: tree.append((top, l2)) I would really like to turn this into a list comprehension: tree = [ (top, level2(top)) for top in tops if level2(top) ] but the call to level2() is

[Tutor] list iteration question for writing to a file on disk

2007-09-14 Thread sacha rook
Hi can someone help with this please? i got to this point with help from the list. from BeautifulSoup import BeautifulSoupdoc = ['Page title', 'This is paragraph one.', 'This is paragraph two.', 'http://www.google.co.uk";>', 'http://www.bbc.co.uk";>', 'http:/

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread William O'Higgins Witteman
On Tue, Aug 14, 2007 at 08:11:33PM +0100, Tom Fitzhenry wrote: >On Tue, Aug 14, 2007 at 11:06:05AM -0700, Dick Moores wrote: >> Replying only to the list takes a bit of trouble. The default >> behavior seems to be that the "Reply" button addresses the author >> only and not the list; "Reply to al

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Carroll, Barry
> Date: Tue, 14 Aug 2007 12:33:16 -0700 > From: Dick Moores <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Question re Tutor List Etiquette > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us-ascii"; format=flowed

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Dick Moores
At 11:56 AM 8/14/2007, Kent Johnson wrote: >Dick Moores wrote: > > When sending a reply to a post, to the list, should we also address > > the reply to the author of the post to which we are replying? > > (There's gotta be an easier way to say that..) If we do so, then the > > author gets a duplica

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Tom Fitzhenry
On Tue, Aug 14, 2007 at 11:06:05AM -0700, Dick Moores wrote: > Replying only to the list takes a bit of trouble. The default > behavior seems to be that the "Reply" button addresses the author > only and not the list; "Reply to all" addresses both the list, the > author, and any others included

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Kent Johnson
Dick Moores wrote: > When sending a reply to a post, to the list, should we also address > the reply to the author of the post to which we are replying? > (There's gotta be an easier way to say that..) If we do so, then the > author gets a duplicate of our reply. This is configurable for each s

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Luke Paireepinart
Dick Moores wrote: > When sending a reply to a post, to the list, should we also address > the reply to the author of the post to which we are replying? > (There's gotta be an easier way to say that..) If we do so, then the > author gets a duplicate of our reply. > > I've run some statistics (bu

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Eric Brunson
Dick Moores wrote: > When sending a reply to a post, to the list, should we also address > the reply to the author of the post to which we are replying? > (There's gotta be an easier way to say that..) If we do so, then the > author gets a duplicate of our reply. > > I've run some statistics (bu

[Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Dick Moores
When sending a reply to a post, to the list, should we also address the reply to the author of the post to which we are replying? (There's gotta be an easier way to say that..) If we do so, then the author gets a duplicate of our reply. I've run some statistics (but no more bar graphs ;-) ). My

Re: [Tutor] List within Dictionary

2007-06-20 Thread Kent Johnson
pearl jb wrote: > I wanted to know "How to access the list elements which is in Dictionary" > > dict = {'John':['ph=919873673','res=91928827737'] , 'William' : > ['ph=91983763','res=91837474848'] } > > > I want the output to be > > 1. John res=91928827737 > 2. William ph=91983763 You can use

[Tutor] List within Dictionary

2007-06-20 Thread pearl jb
I wanted to know "How to access the list elements which is in Dictionary" dict = {'John':['ph=919873673','res=91928827737'] , 'William' : ['ph=91983763','res=91837474848'] } I want the output to be 1. John res=91928827737 2. William ph=91983763 - On

Re: [Tutor] List slicing and joining

2007-04-11 Thread Andreas Kostyrka
* Ben Sherman <[EMAIL PROTECTED]> [070411 22:02]: > I've got a list that contain a bunch of information, including the > FQDN of a host. > > host_data=['foo.example.com', 'other unimportant data'] > > I need to seperate the hostname from the domain name. > > This is how I'm doing it, and it work

[Tutor] List slicing and joining

2007-04-11 Thread Ben Sherman
I've got a list that contain a bunch of information, including the FQDN of a host. host_data=['foo.example.com', 'other unimportant data'] I need to seperate the hostname from the domain name. This is how I'm doing it, and it work, but it seems *really* hacky. Is there a better (or more pythony)

Re: [Tutor] List and comprehension questions

2007-02-25 Thread Bob Gailer
Kent Johnson wrote: > Smith, Jeff wrote: > >> I'm getting use to using list iteration and comprehension but still have >> some questions. >> >> 1. I know to replace >> for i in range(len(list1)): >> do things with list1[i] >> with >> for li in list1: >> do things with li

Re: [Tutor] List and comprehension questions

2007-02-25 Thread Kent Johnson
Smith, Jeff wrote: > I'm getting use to using list iteration and comprehension but still have > some questions. > > 1. I know to replace > for i in range(len(list1)): > do things with list1[i] > with > for li in list1: > do things with li > but what if there are two lists t

[Tutor] List and comprehension questions

2007-02-25 Thread Smith, Jeff
I'm getting use to using list iteration and comprehension but still have some questions. 1. I know to replace for i in range(len(list1)): do things with list1[i] with for li in list1: do things with li but what if there are two lists that you need to access in sync. Is the

Re: [Tutor] list problem

2007-02-21 Thread Kent Johnson
> Kirk Bailey wrote: >> ok, here comes some code: >> >> f1=open(pagename,'r') >> page=f1.readlines() >> f1.close() >> >> at the end of which, the data is in page, which is a list. But >> something strange is going on here. all the data is in a single cell! >> it's a one cell list! Say what? It s

Re: [Tutor] list problem

2007-02-21 Thread Michael Lange
On Wed, 21 Feb 2007 21:21:26 +1300 "John Fouhy" <[EMAIL PROTECTED]> wrote: > > Kirk Bailey wrote: > > > ok, here comes some code: > > > > > > f1=open(pagename,'r') > > > page=f1.readlines() > > > f1.close() > > > > > > at the end of which, the data is in page, which is a list. But > > > something

Re: [Tutor] list problem

2007-02-21 Thread John Fouhy
> Kirk Bailey wrote: > > ok, here comes some code: > > > > f1=open(pagename,'r') > > page=f1.readlines() > > f1.close() > > > > at the end of which, the data is in page, which is a list. But > > something strange is going on here. all the data is in a single cell! > > it's a one cell list! Say what

Re: [Tutor] list problem

2007-02-20 Thread Luke Paireepinart
Kirk: Please reply to this message, not the other one I sent, and please reply on-list in the future, using the 'reply-all' button rather than 'reply.' Otherwise the message just goes to me instead of to everyone, which is the default on this list. This copy of your e-mail is forwarded to the lis

Re: [Tutor] list problem

2007-02-20 Thread Rikard Bosnjakovic
On 2/21/07, Kirk Bailey <[EMAIL PROTECTED]> wrote: [...] > Discussion on or off list is saught. Constructive criticism will be > graciously received and thanked. Without links, pointers, code or anything grippable I find it difficult to comment or discuss anything, since i haven't got the faintes

Re: [Tutor] list problem

2007-02-20 Thread Luke Paireepinart
Kirk Bailey wrote: > ok, getting back to python and wikiness, I have a problem, this software > of mine seems to exibit different behavior under the latest edition of > python (2.5) than under the version used when I first wrote it (2.3). > > It loads the page file, but returns it as a list (whic

[Tutor] list problem

2007-02-20 Thread Kirk Bailey
ok, getting back to python and wikiness, I have a problem, this software of mine seems to exibit different behavior under the latest edition of python (2.5) than under the version used when I first wrote it (2.3). It loads the page file, but returns it as a list (which is correcft) of one eleme

Re: [Tutor] Replying to the tutor-list

2007-02-18 Thread Tim Golden
Dave Kuhlman wrote: > On Fri, Feb 16, 2007 at 11:28:21AM +, Tim Golden wrote: >> Kent Johnson wrote: >>> Tim Golden wrote: field and [EMAIL PROTECTED] in cc: My problem there is that I usually don't want to send the originating individual a private copy of an email he/she is goin

Re: [Tutor] Replying to the tutor-list

2007-02-18 Thread Dave Kuhlman
On Fri, Feb 16, 2007 at 11:28:21AM +, Tim Golden wrote: > Kent Johnson wrote: > > Tim Golden wrote: > >> field and [EMAIL PROTECTED] in cc: My problem there is that I usually > >> don't want to send the originating individual a private copy > >> of an email he/she is going to receive from the l

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Carroll, Barry
Greetings: I just thought I'd throw my own hat into the ring. I'm trying out my new, asbestos-free, flame-retardant underwear. ;^) > -Original Message- > Date: Fri, 16 Feb 2007 08:14:29 -0500 > From: "Michael P. Reilly" <[EMAIL PROTECTED]> > Subj

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Roel Schroeven
Tim Golden schreef: > I would take minor issue -- with you, and with the creators > of Thunderbird which is my current mail client of choice. It > looks to me as though you're suggesting that the reply-all > button is there to reply to a list, whereas it seems to me > to be there to reply to all th

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Michael P. Reilly
On 2/16/07, ALAN GAULD <[EMAIL PROTECTED]> wrote: > However, the "standard behavior" at the time was that > replies went back to the mailing list, not to the original sender. But the mailing list was the original sender so it was all wonderfully consistent. Reply goes to sender only, which hap

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Michael P. Reilly
On 2/16/07, Alan Gauld <[EMAIL PROTECTED]> wrote: As to standard list behaviour, I don't know of any list thats been around for more than say 10 years that uses Reply to send to All. This seems to be a very recent thing. (And most of the lists I am on have been around for much more than 10 years

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Tim Golden
Kent Johnson wrote: > Tim Golden wrote: >> field and [EMAIL PROTECTED] in cc: My problem there is that I usually >> don't want to send the originating individual a private copy >> of an email he/she is going to receive from the list in any >> case, so I usually cut-and-paste around so that only the

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Kent Johnson
Tim Golden wrote: > field and [EMAIL PROTECTED] in cc: My problem there is that I usually > don't want to send the originating individual a private copy > of an email he/she is going to receive from the list in any > case, so I usually cut-and-paste around so that only the list > is in To: AFAIK, T

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Tim Golden
Tim Golden wrote: > Alan Gauld wrote: >> But its obvious there are two views at work here. > > (The one which sees an apostrophe in "it's" and the > one which doesn't? ;) > > But, joking aside, I think you've summarised the situation > quite well, and I suspect that -- given the what must be > th

<    1   2   3   4   5   6   7   8   >