On Fri, Jan 2, 2009 at 6:12 PM, Sander Sweers wrote:
> Hello All,
>
> While trying to inderstand Kent's script [1] I struggle on the use of
> operator.itemgetter(1) from the following piece of code. I understand
> it makes it sort on the second value of the counts.iteritems but I do
> not understa
Hi again,
I need to check the validity of the email of the user before data is
written onto the system.
http://paste.lisp.org/display/72986
Is this a correct method to proceed or is there a better solution.
Thanks
Norman
___
Tutor maillist - Tuto
On Sat, Jan 3, 2009 at 10:48 AM, bob gailer wrote:
> bob gailer wrote:
>>
>>
>> for fn in files:
>> base, ext = os.path.splitext(fn)
>> if ext in ['.flac','.mp3','.m4a']: ## CORRECTION removed *
>>
>>
>
for fn in files:
base, ext = os.path.splitext(fn)
if ext.lower() in ['.flac', '.mp3'
On Fri, Jan 2, 2009 at 6:44 PM, bob gailer wrote:
> Since file is a built-in function it is a good idea to not use it as a
> variable name.
Oooh! I did not know that ... thanks ... went through and changed them all.
> for fn in files:
> base, ext = os.path.splitext(fn)
> if ext in ['*.flac'
bob gailer wrote:
Damon Timm wrote:
Hi - am learning Pythong and loving it! Anyhow, what I have works,
but I wondered if there was a "better" (more python-y) way.
Here is what I am doing with fnmatch ... am thinking there has to be a
one-line way to do this with a lambda or list comprehension
Damon Timm wrote:
Hi - am learning Pythong and loving it! Anyhow, what I have works,
but I wondered if there was a "better" (more python-y) way.
Here is what I am doing with fnmatch ... am thinking there has to be a
one-line way to do this with a lambda or list comprehension ... but my
mind ca
Hi - am learning Pythong and loving it! Anyhow, what I have works,
but I wondered if there was a "better" (more python-y) way.
Here is what I am doing with fnmatch ... am thinking there has to be a
one-line way to do this with a lambda or list comprehension ... but my
mind can't get around it ..
"Kent Johnson" wrote
To actually *constrain* a collection to be homogeneous seems
extremely
un-pythonic. In actual fact all containers can hold whatever you
want
to put in them without restriction (except hashability requirements
for sets and dict keys).
And strings which are kind of a col
Hello All,
While trying to inderstand Kent's script [1] I struggle on the use of
operator.itemgetter(1) from the following piece of code. I understand
it makes it sort on the second value of the counts.iteritems but I do
not understand how operator.itemgetter(1) works.
for name, count in
sorted(
Kent Johnson wrote:
[snip]
To actually *constrain* a collection to be homogeneous seems extremely
un-pythonic. In actual fact all containers can hold whatever you want
to put in them without restriction (except hashability requirements
for sets and dict keys).
Well, the array module offers o
On Fri, Jan 2, 2009 at 10:37 PM, Kent Johnson wrote:
> Forwarding to the list with comments.
>
> On Fri, Jan 2, 2009 at 2:47 PM, spir wrote:
>> Now, remains one major question:
>> Why do lists hold heterogeneous items? (Why did Guido do that choice, and
>> then assert that
>> lists are for homo
Forwarding to list...
- Forwarded Message
yes i want to clear the images before the next iteration,here is the pseudo
code what i want to do
a = [ ]
for i in range(self.numOne)
a.append([i])
to create an empty array, and append the index i to the array and pass this
index to gtk im
Forwarding to the list with comments.
On Fri, Jan 2, 2009 at 2:47 PM, spir wrote:
> On Fri, 2 Jan 2009 11:57:32 -0500
> "Kent Johnson" wrote:
>
>> On Fri, Jan 2, 2009 at 11:10 AM, spir wrote:
>> > Can someone explain the following?
>> >
>> >
>> > class Type(object):
Norman Khine wrote:
Hello,
I have this code, is there a better way to get the desired output.
http://paste.lisp.org/display/72966
I'd add the variable information e g. ('fr', 'ascii', '%.2f', '%s %s'])
to the individual dictionaries. Then all the relevant data is in one
place. Then you need
Hello,
I have this code, is there a better way to get the desired output.
http://paste.lisp.org/display/72966
Thanks
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Fri, Jan 2, 2009 at 1:36 PM, Paul McGuire wrote:
> The example you cited of creating a thin derived class from object, for the
> simple purpose of supporting dynamically assigned attributes, sometimes goes
> by the name Bag, from the Smalltalk object framework.
Another variation is Bunch, tho
On Fri, 2 Jan 2009 12:36:42 -0600
"Paul McGuire" wrote:
> Denis -
Hello Paul,
pleased to read you again ;-)
> What you are seeing is standard procedure for any built-in type - no dynamic
> assignment of attributes allowed. Here is an analogous case to your
> example, but based on str instead
Denis -
What you are seeing is standard procedure for any built-in type - no dynamic
assignment of attributes allowed. Here is an analogous case to your
example, but based on str instead of object:
greeting = "bon jour"
greeting.language = "French" # raises AttributeError: 'str' object has no
a
"Norman Khine" wrote
>>> currencies = [{'sign': '\xe2\x82\xac', 'id': 'EUR',
>>> 'is_selected':
False, 'title': 'EURO'}, {'sign': '\xc2\xa3', 'id': 'GBP',
'is_selected': True, 'title': 'Pound'}, {'sign': '$', 'id': 'USD',
'is_selected': False, 'title': 'Dollar'}]
What is the simplest way t
On Fri, Jan 2, 2009 at 11:10 AM, spir wrote:
> Can someone explain the following?
>
>
> class Type(object):
>pass
> o = Type()
> o.a = 1
> print o, o.a
> print dir(object)
> ==> ['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__',
> '__init_
"spir" wrote
Can someone explain the following?
Not really an explanation but I did notice when repeating your
experiment that your class instance has a __dict__ attribute
but object does not. The new attribute a is apparently
located in the dict.
class C(object): pass
...
o = object()
c
"i i" wrote in
self.numOne = random.randint(1,10)
for i in range(self.numOne):
self.image = gtk.Image()
self.image.set_from_file("./Pink-Flower-32x32.png")
self.fixed.put(self.image, i*25, 0)
self.image.show()
images,i want to initialize the array or empt
"Roel Schroeven" wrote
In the point of view taken by Guido and the writer of the blogs
mentioned before, a tuple of x, y coordinates is not homogeneous,
it's
heterogeneous. Both x and y do have the same type, but that's not
the
point. The point is that the meaning of the two elements is
diff
Can someone explain the following?
class Type(object):
pass
o = Type()
o.a = 1
print o, o.a
print dir(object)
==> ['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__',
'__init__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setat
On Fri, Jan 2, 2009 at 8:17 AM, Norman Khine wrote:
> Hello,
> I have this list
>
currencies = [{'sign': '\xe2\x82\xac', 'id': 'EUR', 'is_selected':
False, 'title': 'EURO'}, {'sign': '\xc2\xa3', 'id': 'GBP', 'is_selected':
True, 'title': 'Pound'}, {'sign': '$', 'id': 'USD', 'is_sele
On Fri, Jan 2, 2009 at 8:13 AM, Sander Sweers wrote:
> On Fri, Jan 2, 2009 at 13:52, Kent Johnson wrote:
>> Or ask more questions, that works too!
>
> So you and Alan ask the most questions ;-)
No, that honor goes to Dick Moores. He is in the top 10 in 4 of the
last 5 years!
> Thanks to all the
Alan Gauld schreef:
> "Kent Johnson" wrote
>> For what it's worth, Guido has explicitly said,
>> "Tuples are for heterogeneous data, list are for homogeneous data.
>> Tuples are *not* read-only lists."
>
> That surprises me, he has always seemed more pragmatist than purist.
> However even Guido s
Hello,
I have this list
>>> currencies = [{'sign': '\xe2\x82\xac', 'id': 'EUR', 'is_selected':
False, 'title': 'EURO'}, {'sign': '\xc2\xa3', 'id': 'GBP',
'is_selected': True, 'title': 'Pound'}, {'sign': '$', 'id': 'USD',
'is_selected': False, 'title': 'Dollar'}]
What is the simplest way to e
On Fri, Jan 2, 2009 at 13:52, Kent Johnson wrote:
> Or ask more questions, that works too!
So you and Alan ask the most questions ;-)
Seriously now, this really shows the power of Python and I'll have a
good time figuring out how this exactly works.
Thanks to all the Tutors for year of great su
On Fri, Jan 2, 2009 at 5:34 AM, Alan Gauld wrote:
> I think the figures reflect the general level of activity on the list.
> We seem to have peaked in 2005...
> Statistics, don't you love 'em :-)
I couldn't resist adding a total number of posts and percent to the
calculations. Statistics + pytho
On Fri, Jan 2, 2009 at 2:06 AM, Luke Paireepinart
wrote:
> Yeah, I agree. Interesting script, Kent. Surprisingly short.
>
> I didn't realize I wasn't in the top 5 posters for 2008! I guess I
> have a new year's resolution to be more helpful.
Or ask more questions, that works too!
Kent
Hi,
i am making an activity in glade.here is the code
self.numOne = random.randint(1,10)
for i in range(self.numOne):
self.image = gtk.Image()
self.image.set_from_file("./Pink-Flower-32x32.png")
self.fixed.put(self.image, i*25, 0)
self.image.sh
On Thu, 01 Jan 2009 11:04:42 -0500
"Keith Reed" wrote:
> I'm having trouble assigning a dictionary as a value within another:
>
>
> Code Snippet Start
>
> for line in fromchild.readlines():
> itemarray = line.strip().split(":")
> parent
"Kent Johnson" wrote
that generates it. The lists for previous years (back to 2003) are
at
the end so everyone on the list doesn't hit the archives to find out
Alan, I thought you might have passed me this year but we are both
off
a little :-)
I think the figures reflect the general lev
34 matches
Mail list logo