Re: [Tutor] Tutor Digest, Vol 30, Issue 68

2006-08-21 Thread Carroll, Barry
Hello, Marcus > Date: Mon, 21 Aug 2006 16:50:37 -0400 > From: "Marcus Goldfish" <[EMAIL PROTECTED]> > Subject: [Tutor] custom container subclassing list-- slices are > lists!? > To: Tutor > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, >

Re: [Tutor] how to get an email attachment

2006-08-21 Thread shawn bright
Yes, indeed. I found in the essential reference book. It looks like it works in the email module also. I will try a few things out here and let you know how it goes.thanks.shawn On 8/21/06, Alan Gauld <[EMAIL PROTECTED]> wrote: I'm no expert here, but isn't there a Mime module forhandling mail atta

Re: [Tutor] Big wad of Python tutorials

2006-08-21 Thread shawn bright
way cool, thanks !-skOn 8/21/06, Carroll, Barry <[EMAIL PROTECTED]> wrote: > -Original Message-> Date: Mon, 21 Aug 2006 13:52:45 -0700 (PDT)> From: Terry Carroll <[EMAIL PROTECTED]>> Subject: [Tutor] Big wad of Python tutorials > To: tutor@python.org> Message-ID:>   <[EMAIL PROTECTED] >

Re: [Tutor] Big wad of Python tutorials

2006-08-21 Thread Carroll, Barry
> -Original Message- > Date: Mon, 21 Aug 2006 13:52:45 -0700 (PDT) > From: Terry Carroll <[EMAIL PROTECTED]> > Subject: [Tutor] Big wad of Python tutorials > To: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: TEXT/PLAIN; charset=US-ASCII > > > This page, consis

Re: [Tutor] how to get an email attachment

2006-08-21 Thread Alan Gauld
I'm no expert here, but isn't there a Mime module for handling mail attachments? Might be worth a look. Alan G. - Original Message - From: "shawn bright" <[EMAIL PROTECTED]> To: "tutor-python" Sent: Monday, August 21, 2006 9:50 PM Subject: [Tutor] how to get an email attachment > lo t

Re: [Tutor] custom container subclassing list-- slices are lists!?

2006-08-21 Thread John Fouhy
On 22/08/06, Marcus Goldfish <[EMAIL PROTECTED]> wrote: > Second, I think I found a partial answer in the Feb 22, 2005 tutor thread > http://aspn.activestate.com/ASPN/Mail/Message/python-tutor/2502290. > To preserve type, I need to override some special functions. In the case > of slicing, I need

Re: [Tutor] custom container subclassing list-- slices are lists!?

2006-08-21 Thread Marcus Goldfish
On 8/21/06, Marcus Goldfish <[EMAIL PROTECTED]> wrote: I'd like to sublcass the built-in list type to create my own container.  How can I make slices of the list be of type myclass-- currently they are lists.  Example:>>> class MyFoo(list):   def __init__(self, inlist):   se

Re: [Tutor] custom container subclassing list-- slices are lists!?

2006-08-21 Thread John Fouhy
On 22/08/06, Marcus Goldfish <[EMAIL PROTECTED]> wrote: > >>> class MyFoo(list): >def __init__(self, inlist): > self = inlist[:] Um, I'm fairly sure this line is not doing what you think it is doing! self is just a local variable. When __init__ is called, self is bo

[Tutor] Big wad of Python tutorials

2006-08-21 Thread Terry Carroll
This page, consisting of links to a few hundred topically sorted Python tutorials, was mentioned on Digg recently. I thought I'd pass on the URL: http://www.awaretek.com/tutorials.html Many of the URLs will be familiar to some on this list, but many more are new, certainly at least to me. __

[Tutor] custom container subclassing list-- slices are lists!?

2006-08-21 Thread Marcus Goldfish
Hi,I'd like to sublcass the built-in list type to create my own container.  How can I make slices of the list be of type myclass-- currently they are lists.  Example:>>> class MyFoo(list):   def __init__(self, inlist):   self = inlist[:]>>> me = MyFoo(range(10))>>> type(me)>

[Tutor] how to get an email attachment

2006-08-21 Thread shawn bright
lo there pythoneers !i have a simple script to pull some emails from a pop server.so far, its working. What i need to do is get an attachment. That attachment is going to be encoded in base 64.so, i am looking and i can't find how to get the attachment. I have some info on the base64 module, so i s

Re: [Tutor] Limiting Characters

2006-08-21 Thread Luke Paireepinart
Marcus Dean Adams wrote: > > I’m fairly new to python, I’ve been dabbling in it for school and I > have a question. I’ve written a few programs using graphical windows > with input boxes such as a stopwatch, temperature converter, etc. > I’ve always found a gui much prettier than command line.

Re: [Tutor] tkinter events:

2006-08-21 Thread Luke Paireepinart
Zsiros Levente wrote: [snip code] *def* handler(event): *if* buttonpressed == 1 : /#if the mousebutton is pressed and moved, circles should appear, but they do not/ can.create_oval(event.x-r, event.y-r, event.x+r, event.y+r, fill="orange") lab.con

[Tutor] Limiting Characters

2006-08-21 Thread Marcus Dean Adams
I’m fairly new to python, I’ve been dabbling in it for school and I have a question.  I’ve written a few programs using graphical windows with input boxes such as a stopwatch, temperature converter, etc.  I’ve always found a gui much prettier than command line.  Anyway, I have limited the s

Re: [Tutor] A list in list problem

2006-08-21 Thread Dave S
On Monday 21 August 2006 17:41, Alan Gauld wrote: > a=b=[] > a > > > > [] > > > b > > > > [] > > These are the same list. > > a=[1,2,3] > > But here you create a new list and assign it to a. > > a > > > > [1, 2, 3] > > > b > > > > [] > > So a points to the new list and

Re: [Tutor] A list in list problem

2006-08-21 Thread Alan Gauld
a=b=[] a > [] b > [] These are the same list. a=[1,2,3] But here you create a new list and assign it to a. a > [1, 2, 3] b > [] So a points to the new list and b to the original. > Tinkering some more I think it is the append that did it. Yes, the append adds th

Re: [Tutor] A list in list problem

2006-08-21 Thread Dave S
On Monday 21 August 2006 13:58, János Juhász wrote: > Hi Dave, > > > From: dave s <[EMAIL PROTECTED]> > > Subject: [Tutor] A list in list problem > > To: python tutor > > Message-ID: <[EMAIL PROTECTED]> > > Content-Type: text/plain; charset="us-ascii" > > > > def CSV_Lines(self, csv, from_, to):

Re: [Tutor] A list in list problem

2006-08-21 Thread Dave S
On Monday 21 August 2006 13:40, Alan Gauld wrote: > > So when I needed to make a list of a list in the following code I > > thought no > > problem ... > > > > > > def CSV_Lines(self, csv, from_, to): > >"""Returns a list of cleaned up lines from csv 'from_' line > > number 'to' line numb

Re: [Tutor] [Fwd: [Fwd: self-modification]]

2006-08-21 Thread Kent Johnson
Zsiros Levente wrote: > Sorry, the source was for my tkinter question. I'm a bit disorganized > today. > > The problematic part is the 11. line, where I have to convert the item > selected from the list to an object, or something like that. At the > moment it only applies to a string object, but

Re: [Tutor] [Fwd: self-modification]

2006-08-21 Thread Alan Gauld
> I forgot the most important thing: the attachment. OK, Here is my annotated version. not sure if it will solve your problem though... # #!/usr/bin/python # In this program I wanted to write the event > on my own, combining , and from Tkinter import * def handl

[Tutor] [Fwd: [Fwd: self-modification]]

2006-08-21 Thread Zsiros Levente
Sorry, the source was for my tkinter question. I'm a bit disorganized today. The problematic part is the 11. line, where I have to convert the item selected from the list to an object, or something like that. At the moment it only applies to a string object, but I want to call the function

Re: [Tutor] self-modification

2006-08-21 Thread Alan Gauld
> I'm a newbie to Python. I wanted to write a graphical interface > which would show the built-in documentation (I mean dir() and > __doc__ ) of Python. The code shows how far I got before realizing > that I had to use some self-modification feature (converting a > string to a function or to an

[Tutor] tkinter events:

2006-08-21 Thread Zsiros Levente
  #!/usr/bin/python # In this program I wanted to write the event on my own, combining , and , # but unfortunetly it doesn't work. No syntax errors.  from Tkinter import * def handler(event): if buttonpressed == 1 : #if the mousebutton is pressed and moved, circles should appear, but

Re: [Tutor] self-modification

2006-08-21 Thread Kent Johnson
Zsiros Levente wrote: > I'm a newbie to Python. I wanted to write a graphical interface which > would show the built-in documentation (I mean dir() and __doc__ ) of > Python. The code shows how far I got before realizing that I had to use > some self-modification feature (converting a string to

[Tutor] [Fwd: self-modification]

2006-08-21 Thread Zsiros Levente
I forgot the most important thing: the attachment. Original Message Subject:self-modification Date: Mon, 21 Aug 2006 16:04:19 +0200 From: Zsiros Levente <[EMAIL PROTECTED]> To: python tutor I'm a newbie to Python. I wanted to write a graphical interface which

[Tutor] self-modification

2006-08-21 Thread Zsiros Levente
I'm a newbie to Python. I wanted to write a graphical interface which would show the built-in documentation (I mean dir() and __doc__ ) of Python. The code shows how far I got before realizing that I had to use some self-modification feature (converting a string to a function or to an object; i

Re: [Tutor] A list in list problem

2006-08-21 Thread János Juhász
Hi Dave, > From: dave s <[EMAIL PROTECTED]> > Subject: [Tutor] A list in list problem > To: python tutor > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain;  charset="us-ascii" > def CSV_Lines(self, csv, from_, to): > """Returns a list of cleaned up lines from csv 'from_' line > numbe

Re: [Tutor] A list in list problem

2006-08-21 Thread Alan Gauld
> So when I needed to make a list of a list in the following code I > thought no > problem ... > > > def CSV_Lines(self, csv, from_, to): >"""Returns a list of cleaned up lines from csv 'from_' line > number 'to' line number""" > >clean_line = clean_csv = [] So clean_line is a

Re: [Tutor] A list in list problem

2006-08-21 Thread Dave S
On Monday 21 August 2006 10:59, dave s wrote: Several hours +1 Sometimes it is usefull spelling out my problem in an email - seems to clarify it - maybe when I get to the 'im stuck' I should send an email to myself :) clean_csv.append(clean_line) ... should by clean_csv.append(clean_line[:])

[Tutor] A list in list problem

2006-08-21 Thread dave s
Help :) I have been playing with this for several hours & am totally stuck ! I am happy with the following ... >>> a=[1,2,3] >>> b=[5,6,7] >>> a [1, 2, 3] >>> b [5, 6, 7] >>> g=[] >>> g [] >>> g.append(a) >>> g [[1, 2, 3]] >>> g.append(b) >>> g [[1, 2, 3], [5, 6, 7]] >>> So when I needed to ma