E.g., so we could write
for x in seq if x is not None:
print repr(x), "isn't None ;-)"
instead of
for x in (x for x in seq if x is not None):
print repr(x), "isn't None ;-)"
just a thought.
Regards,
Bengt Richter
--
http://mail.python.org/mailman/listinfo/python-list
This is perfect. Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Bengt Richter wrote:
> E.g., so we could write
>
> for x in seq if x is not None:
Chundrous; looks like that p**l language ...
> print repr(x), "isn't None ;-)"
>
> instead of
>
> for x in (x for x in seq if x is not None):
Byzantine ...
> print repr(x), "isn't None ;
"Reid Priedhorsky" <[EMAIL PROTECTED]> wrote:
> Dear group,
>
> I'd have a class defined in one module, which descends from another class
> defined in a different module. I'd like the superclass to be able to
> access objects defined in the first module (given an instance of the first
> class) wit
Thank you guys! (Reinhold, Mark and Markus) I must confess that I am
absolutely awe struck at the power of this language! There is no way in the
world that I would have envisaged such simple and elegant solutions!!!
Reinhold, is your solution specific to 2.4?
Kind Regards,
Ric
"Reinhold Bir
[Tim Peters]
>> All Python behavior in the presence of infinities, NaNs, and signed
>> zeroes is a platform-dependent accident, mostly inherited from that
>> all C89 behavior in the presence of infinities, NaNs, and signed
>> zeroes is a platform-dependent crapshoot.
[Michael Hudso
geon schrieb:
> Hi,
>
> When I try to upload many files I get such a error message:
>
> [...] traceback deleted
>
> ftputil.ftp_error.TemporaryError: 421 Login Timeout (25 seconds): closing
> contro
> l connection.
>
> I think its not about many files but because of it takes too long for my ft
It really does depend. For instance, some other programmers where I
work came up with a way to represent a hierarchical, somewhat random
data set by creating each object and then adding attributes to those
for each subobject, and so on down the tree. However, you could never
really be sure that t
I am writing a Python script that uses the win32all winsound package to
play a .wav file. I the sound come out of the left hand speaker, but
not the right hand speaker.
I've look at some Python sound libraries (PySonic, Audiere, pygame), as
well as any number of command line .wav file players. For
Bengt Richter wrote:
> E.g., so we could write
>
> for x in seq if x is not None:
> print repr(x), "isn't None ;-)"
>
> instead of
>
> for x in (x for x in seq if x is not None):
> print repr(x), "isn't None ;-)"
>
> just a thought.
>
> Regards,
> Bengt Richter
Is it n
"edgrsprj" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> PROPOSED EARTHQUAKE FORECASTING
> COMPUTER PROGRAM DEVELOPMENT EFFORT
> Posted July 11, 2005
The first posting in this series should have provided computer
programming groups around the world with a good understanding
On Monday 11 July 2005 15:23, David Isaac <[EMAIL PROTECTED]>
(<[EMAIL PROTECTED]>) wrote:
> Why don't tuples support an index method?
19:27:32:~ $ python
Python 2.3.5 (#2, Jun 19 2005, 13:28:00)
[GCC 3.3.6 (Debian 1:3.3.6-6)] on linux2
Type "help", "copyright", "credits" or "license" for
Jules Dubois wrote:
> On Monday 11 July 2005 15:23, David Isaac <[EMAIL PROTECTED]>
> (<[EMAIL PROTECTED]>) wrote:
>
>>Why don't tuples support an index method?
>
> 19:27:32:~ $ python
> Python 2.3.5 (#2, Jun 19 2005, 13:28:00)
> [GCC 3.3.6 (Debian 1:3.3.6-6)] on linux2
> Type "help", "co
I should have been more specific. The report needs to be presentable to
my users and needs to have rich text type properties (multiple colors,
tables, etc) Therefore, I would like to use html if possible.
I didn't know if there was already a report writing type of utility
already built using py
On Tue, 12 Jul 2005 10:12:33 +1000, John Machin <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
>> E.g., so we could write
>>
>> for x in seq if x is not None:
>
>Chundrous; looks like that p**l language ...
^--piqued my interest, where'd that come from? ;-)
>
>> print repr
HTMLgen looks like it might fit the bill.
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> I should have been more specific. The report needs to be presentable to
> my users and needs to have rich text type properties (multiple colors,
> tables, etc) Therefore, I would like to use ht
How does setdefault work exactly? I am looking in the docs and can't figure
it out...
Ric
"Ric Da Force" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thank you guys! (Reinhold, Mark and Markus) I must confess that I am
> absolutely awe struck at the power of this language! Th
The snippet of code below gives the result which follows
for k in ut.keys():
name= k.split('_')
print '\n1', name
if len(name) > 1:
name[0]= name[0] + name[1].capitalize()
print '2', name
name[0]= name[0].capitalize()
print '3', name
1 ['logical', 'or']
2 ['logicalOr', 'o
Python411 is a series of podcasts about Python, aimed at hobbyists and
others who are learning Python. Each episode focuses on one aspect of
learning Python, or one kind of Python programming, and points to
online tools and tutorials. Python related news and events will also be
reported upon.
This
On Mon, 11 Jul 2005 13:47:22 -0700, [EMAIL PROTECTED] wrote:
> I am using this function to parse data I have stored in an array.
>
> This is what the array looks like:
>
> [['Memory', '0', 'Summary', '0'], ['Memory', '0', 'Speed',
> 'PC3200U-30330'], ['Memory', '0', 'Type', 'DDR SDRAM'], ... ]
On Mon, 11 Jul 2005 21:18:40 +0530, Dark Cowherd wrote:
> I tend to use exceptions, but I think Joel has a point.
Joel being "Joel On Software" Joel.
> Taking the example code that you have given above.
>
> Let us assume that somebody else is using my_function and DOES NOT
> write a try except
On Mon, 11 Jul 2005 19:37:03 -0400,
Mike Meyer <[EMAIL PROTECTED]> wrote:
> The question is - how far are you really willing to carry this? What
> do you think of allowing arbitrary lvalues, with the assumption that
> the previous arguments are all defined (ala let*)? So you could do:
> class gro
Ric Da Force wrote:
> How does setdefault work exactly? I am looking in the docs and can't figure
> it out...
If the key (the first argument) already exists in the dictionary, the
corresponding value is returned. If the key does not exist in the
dictionary, it is stored in the dictionary and b
David Isaac wrote:
> Why don't tuples support an index method?
> It seems natural enough ...
This question has been posed several (many?) times in the past. See the
archives for more detail, but basically the answer that is usually given
is this:
Tuples are intended to be used somewhat like C
Colin J. Williams wrote:
> The snippet of code below gives the result which follows
>
> for k in ut.keys():
>name= k.split('_')
>print '\n1', name
>if len(name) > 1:
> name[0]= name[0] + name[1].capitalize()
> print '2', name
>name[0]= name[0].capitalize()
>print '3',
On Mon, 11 Jul 2005 18:45:20 -0500, Reid Priedhorsky <[EMAIL PROTECTED]> wrote:
>Dear group,
>
>I'd have a class defined in one module, which descends from another class
>defined in a different module. I'd like the superclass to be able to
>access objects defined in the first module (given an inst
[EMAIL PROTECTED] wrote:
> Python411 is a series of podcasts about Python, aimed at hobbyists and
> others who are learning Python. Each episode focuses on one aspect of
> learning Python, or one kind of Python programming, and points to
> online tools and tutorials. Python related news and events
Peter Hansen wrote:
> Jorey Bump wrote:
>
>> Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
>>
>>> it's.
>>
>>
>> +1 for this becoming the official name of Python 3000. ;)
>>
>> And now for something completely different...
>>
>> The larch!
>
>
> Sorry, already taken:
>
> '''Larch - John Guttag
Patch / Bug Summary
___
Patches : 349 open ( +1) / 2880 closed ( +1) / 3229 total ( +2)
Bugs: 897 open ( -1) / 5119 closed (+16) / 6016 total (+15)
RFE : 194 open ( +1) / 170 closed ( +0) / 364 total ( +1)
New / Reopened Patches
__
PEP 343 d
I often find myself storing data in a list of tuples, and I want to ask
questions like "what is the index of the first tuple whose 3rd element
is x", or "give me the first tuple whose 2nd element is y".
I know I can do [elem for elem in lst if elem[3] == x][0] or (elem for
elem in lst if elem[2] =
Repton wrote:
> I often find myself storing data in a list of tuples, and I want to ask
> questions like "what is the index of the first tuple whose 3rd element
> is x", or "give me the first tuple whose 2nd element is y".
>
> I know I can do [elem for elem in lst if elem[3] == x][0] or (elem for
Repton wrote:
> I often find myself storing data in a list of tuples, and I want to ask
> questions like "what is the index of the first tuple whose 3rd element
> is x", or "give me the first tuple whose 2nd element is y".
>
> I know I can do [elem for elem in lst if elem[3] == x][0] or (elem for
On Mon, 11 Jul 2005 22:10:33 -0400, "Colin J. Williams" <[EMAIL PROTECTED]>
wrote:
>The snippet of code below gives the result which follows
>
>for k in ut.keys():
> name= k.split('_')
> print '\n1', name
> if len(name) > 1:
> name[0]= name[0] + name[1].capitalize()
> print '2', nam
[David Isaac]
> > Why don't tuples support an index method?
> > It seems natural enough ...
[Peter Hansen]
> This question has been posed several (many?) times in the past. See the
> archives for more detail, but basically the answer that is usually given
> is this:
>
> Tuples are intended to be
On Mon, 11 Jul 2005 13:54:05 +0200, Aaron Bingham wrote:
>> Two dicts are equal if they have the same keys and the same values.
>
> That is what I would expect, but where is that documented? Also,
> where is the behavior of the much less obvious dictionary methods
> __ge__, __gt__, __le__, __lt_
ChrisH wrote:
> Oh. The one other thing I forgot to mention is that the data needs to be
> already updated every 10 minutes or so automatically.
You know, this is the most concise example of feature-creep in a
specification that I've ever seen.
--
http://mail.python.org/mailman/listinfo/python-
Hello there,
I need some thoughts about a web application that i am dreaming
and
drooling about in python. I want a search page to look exactly like
Google. But when i press the search button, it should search a database
in an rdbms like Oracle and provide results.
For example, i
I have released interval-0.2.1 at
http://members.cox.net/apoco/interval/. IntervalSet and
FrozenIntervalSet objects are now (as far as I can tell) functionality
equivalent to set and frozenset objects, except they can contain
intervals as well as discrete values.
Though I have my own unit tes
ç8GûÏßåÍX¬9ZÕ½4ÃYËÖ4ç!ÅðÓu©xò
{ÛYt8°¨Y2fÚ©
L£µñkUpø}RÈ>®©t¶ûÁÂÈcè¾ùúñhL·æ§ðwUĹm^ÈR&«Ài5¸º5¸*ë7ñLi)'ÏtY»jïf2J\ wCê}wW'µæ`;>
--
http://mail.python.org/mailman/listinfo/python-list
I know its been done before, but I'm hacking away on a simple Vector
class.
class Vector(tuple):
def __add__(self, b):
return Vector([x+y for x,y in zip(self, b)])
def __sub__(self, b):
return Vector([x-y for x,y in zip(self, b)])
def __div__(self, b):
return Ve
Replying to myself... how sad.
On Tue, 12 Jul 2005 15:41:46 +1000, Steven D'Aprano wrote:
> That wasn't clear from his post at all. If he had explained what he
> wanted, I wouldn't have wasted my time explaining what he already knew.
On reading it, that came across more snarky than I intended. S
Hello there,
I need some thoughts about a web application that i am dreaming
and drooling about in python. I want a search page to look exactly like
Google. But when i press the search button, it should search a database
in an rdbms like Oracle and provide results.
For example, i
[EMAIL PROTECTED] wrote:
> However, I'd like to add attribute access (magically), so I can do
> this:
>
> v = Vector((1,2,3))
> print v.x
> print v.y
> print v.z
>
> as well as:
>
> print v[0]
> print v[1]
> print v[2]
>
> Has anyone got any ideas on how this might be done?
>>> class Vector(
Hi,
I have a string such as 'C1, C2, C3'. Without assuming that each bit of
text is of fixed size, what is the easiest way to change this list so that
it reads:
'C1, C2 and C3' regardless of the length of the string.
Regards and sorry for the newbie question,
Ric
--
http://mail.python.or
--- Mike Meyer <[EMAIL PROTECTED]> wrote:
> Remember that what we're suggesting is just syntactic sugar.
BTW: That's true for all high-level language constructs. You could do
everything in machine language. A good language is the sum of lots of syntactic
sugar... selected with taste. :)
> You can
Ric Da Force wrote:
> Hi,
>
> I have a string such as 'C1, C2, C3'. Without assuming that each bit of
> text is of fixed size, what is the easiest way to change this list so that
> it reads:
> 'C1, C2 and C3' regardless of the length of the string.
>
> Regards and sorry for the newbie questio
101 - 146 of 146 matches
Mail list logo