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,
>
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
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]
>
> -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
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
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
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
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
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.
__
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)>
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
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.
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
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
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
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
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):
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
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
> 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
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
> 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
#!/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
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
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
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
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
> 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
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[:])
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
30 matches
Mail list logo