On 2008-02-07, Steve Holden <[EMAIL PROTECTED]> wrote:
> Ravi Kumar wrote:
>> I have to design a Web-based CVS client. I could not find any module,
>> cvs-binding in python.
There isn't any afaik. CVS was never designed with scripting in mind. You'll
have to issue the command, then parse the text
On Feb 7, 10:21 pm, ajaksu <[EMAIL PROTECTED]> wrote:
> On Feb 7, 12:52 pm, [EMAIL PROTECTED] wrote:
>
> > I try to install Python in a Dell D620 with XP PRO version 5.1.2600
> > and I am getting this error. I assume that some dlls are missing but I
> > installed form a fresh python-2.5.1.msi with
Working through the Mark Lutz book Programming Python 3rd Edition.
A couple of modules in the "Preview" chapter give me errors. Both on a
shelve.open call:
Pretty simple code, (2nd example):
=code begin=
import shelve
from people import Person, Manager
bob = Person('Bob Smith', 42, 3
On Feb 8, 8:23 am, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Feb 7, 8:44 am, Steve Holden <[EMAIL PROTECTED]> wrote:
>
> > [EMAIL PROTECTED] wrote:
> > > I'd like to know what others think about it, about this anti-feature.
> > > What I can say is that other computer languages too think that boole
Hi there,
I'm a newby in python (I know a little in programmation) and I have
a lot of questions on builtins but my first one is about modules...
I have seen that if I type help() at a prompt, and then 'modules',
I'll be given a list of all modules available, thanks to this group..
But I have s
[EMAIL PROTECTED] writes:
> for those of you who are familiar with the micropledge.com project,
> here is a good opportunity to spend or earn something:
> http://micropledge.com/projects/pysalsa20
I don't understand why a pure python version of salsa20 would be
interesting. Is there some applicat
[EMAIL PROTECTED] writes:
> for those of you who are familiar with the micropledge.com project,
> here is a good opportunity to spend or earn something:
> http://micropledge.com/projects/pysalsa20
By the way, here is a concise implementation of salsa20 in C:
http://www.nightsong.com/phr/crypto/
On Fri, 08 Feb 2008 00:25:14 -0800, loquehumaine wrote:
> I have seen that if I type help() at a prompt, and then 'modules',
> I'll be given a list of all modules available, thanks to this group..
> But I have seen the differences between them and the one in
> dir(__builtins__).
> Why are some mod
Thank you, that's very clear indeed.
"Helmut Jarausch" <[EMAIL PROTECTED]> a écrit dans le message de
news: [EMAIL PROTECTED]
> Sébastien Vincent > I've found some class on the Net which takes basically this form :
>>
>> ##
>> class Foo:
>> def __init__(self):
>> self.tasks = []
> On Feb 7, 12:20 pm, "Sébastien Vincent" free.fr>
> wrote:
> > I've found some class on the Net which takes basically this form :
> >
> > ##
> > class Foo:
> > def __init__(self):
> > self.tasks = []
> >...
> >
> > def method1(self):
> > tasks = []
> > w
On Feb 8, 11:29 am, John Deas <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I made a small script to recursively copy files from a directory tree
> to an exportDir only if they have an mp3 extension :
>
> a=os.walk(os.getcwd())
> for root, dirs, files in a:
> for currFile in files:
>
Sébastien Vincent I've found some class on the Net which takes basically this form :
>
> ##
> class Foo:
> def __init__(self):
> self.tasks = []
>...
>
> def method1(self):
> tasks = []
> while True:
> ...
> append/pop elements into/from tasks
> ...
Hi,
I made a small script to recursively copy files from a directory tree
to an exportDir only if they have an mp3 extension :
a=os.walk(os.getcwd())
for root, dirs, files in a:
for currFile in files:
pathCurrFile=os.path.join(root, currFile)
if mp3Reg.sear
"Santiago Romero" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Why not a Python COMPILER?
Check out CLPython it has a Python compiler, though I highly doubt it is
what you are thinking of.
>From http://common-lisp.net/project/clpython/manual.html
Sometimes, the generated Pyth
Marc 'BlackJack' Rintsch a écrit :
> On Fri, 08 Feb 2008 00:25:14 -0800, loquehumaine wrote:
>
>> I have seen that if I type help() at a prompt, and then 'modules',
>> I'll be given a list of all modules available, thanks to this group..
>> But I have seen the differences between them and the one
On Feb 8, 12:25 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> writes:
> > Be fair -- he's asking what specific features of Python make it
> > hard. That's a reasonable question.
>
> Indeed. The best explanation I've seen explained goes something like
> this: i
On Thu, 07 Feb 2008 18:22:03 +0100, Diez B. Roggisch
<[EMAIL PROTECTED]> wrote:
> Can you provide an example of what you are actually after? The
> descriptor-protocol might come to use there.
Thanks for your responses. I have read the Descriptor protocol how-to,
which clarifies method access on o
www.enmac.com.hk
GSM Mobile Phones, Digital iPods, Digital Clocks, Digital Pens,
Digital Quran. Enjoy these products with Islamic Features (Complete
Holy Quran with Text and Audio, Tafaseer books, Ahadees Books, Daily
Supplications, Universal Qibla Direction, Prayer Timing and much more)
visit our
Hi Larry,
Sorry for accidentally mailing you personally. I fixed the problem, it
was a problem with the search path, and once that was fixed it works
fine!
thanks again,
- Jorgen
On Feb 8, 2008 9:26 AM, Jorgen Bodde <[EMAIL PROTECTED]> wrote:
> Hi Larry,
>
> > Sure there is. Just put double quo
> > val = BETTER foo THAN bar
> >
> > ;-)
> >
> > Cobol-strikes-back-ly yours,
> >
> > George
>
> I use a ETL language/tool that actually has a function for this kind
> of thing:
>
> NulltoValue(value,defaultValue)
>
> it returns defaultValue if value is null otherwise value.
even Ksh has one
On 2008-02-07, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote:
> -On [20080207 22:09], Reedick, Andrew ([EMAIL PROTECTED]) wrote:
>>Errr... didn't one of the novels explain it away by describing the
>>kessel run as a region of space warped by black holes or other objects?
>>Bragging rights
"Wolfgang Draxinger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> jack trades wrote:
>
> > Honestly I never even thought of that, it just sounded like a
> > fun, and easy,
> > project to put my mediocre programming skills to some use.
> > However his main concern is internet predat
Ben Finney wrote:
> "Mariano Suárez-Alvarez" <[EMAIL PROTECTED]> writes:
>
>> On Feb 7, 3:38 pm, [EMAIL PROTECTED] wrote:
>>> [disclaimer dozens of lines long]
>> Is this absurd signature really necessary?
>
> No.
>
> http://www.goldmark.org/jeff/stupid-disclaimers/>
>
"Necessary" is depend
[EMAIL PROTECTED] wrote:
> I'm developing a program that runs using an asyncore loop. Right now
> I can adequately terminate it using Control-C, but as things get
> refined I need a better way to stop it. I've developed another
> program that executes it as a child process using popen2.Popen4().
jack trades wrote:
> Honestly I never even thought of that, it just sounded like a
> fun, and easy,
> project to put my mediocre programming skills to some use.
> However his main concern is internet predators (too much
> Dateline I think) not porn, I should
> have worded it differently in the OP
On Feb 7, 1:47 pm, Amit Gupta <[EMAIL PROTECTED]> wrote:
> On Feb 7, 10:38 am, Amit Gupta <[EMAIL PROTECTED]> wrote:
>
>
>
> > Python'ites
>
> > I searched around "google" to find the answer to this question, but I
> > can't:
>
> > I have a named regexp : x = re.compile("(?P[a-z]+)")
>
> > What I w
On Feb 7, 4:36 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Feb 7, 4:25 pm, Steven D'Aprano <[EMAIL PROTECTED]
>
>
>
> cybersource.com.au> wrote:
> > On Thu, 07 Feb 2008 15:59:13 +0100, Wildemar Wildenburger wrote:
> > > Arnaud Delobelle wrote:
> > >> Personally, between
>
> > >> * foo if foo
Hi all,
I have the following problem:
There are strings describing a UTC time, e.g. " 2008-01-15 22:32:30"
and a string reflecting the time
zone e.g. "-05:00".
What is an elegant way of getting the local time (considering DST -
daylight saving time) with that data?
The date is not important, just
"c james" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
't' in sample == True
> False
It's comparison operator chaining:
't' in sample == True is like 't' == sample == True
and is equivalent to 't' in sample and sample == True
--
http://mail.python.org/mailman/listinfo
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of c james
> Sent: Friday, February 08, 2008 12:10 PM
> To: python-list@python.org
> Subject: keyword 'in' not returning a bool?
>
> Try this
>
> >>> sample = {'t':True, 'f':False}
> >>> 't' in
c james wrote:
> Try this
>
sample = {'t':True, 'f':False}
't' in sample
> True
type('t' in sample)
>
't' in sample == True
> False
>
> Why is this? Now try
bool('t' in sample) == True
> True
>
> Can someone explain what is going on?
>
Precedence. In:
't' in sample
On Friday 08 February 2008 12:10,
jim-on-linux wrote:
> On Friday 08 February 2008 03:36, waltbrad
>
> wrote:
> > Working through the Mark Lutz book
> > Programming Python 3rd Edition.
> >
> > A couple of modules in the "Preview"
> > chapter give me errors. Both on a
> > shelve.open call:
> >
> >
Try this
>>> sample = {'t':True, 'f':False}
>>> 't' in sample
True
>>> type('t' in sample)
>>> 't' in sample == True
False
Why is this? Now try
>>> bool('t' in sample) == True
True
Can someone explain what is going on?
--
http://mail.python.org/mailman/listinfo/python-list
Ryszard Szopa <[EMAIL PROTECTED]> writes:
>> The main determinant of Python's performance isn't the interpreter
>> overhead, but the amount of work that must be done at run-time and
>> cannot be moved to compile-time or optimized away.
>
> Well, I am still not convinced that Python is intrinsicall
On Jan 31, 10:12 am, erikcw <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a list of numbers each with a +/- margin of error. I need to
> identify which ones overlab each other.
>
Here's my proposal, using arithmetic instead of sets. Looking at the
problem graphically, I drew different numberlines:
Daniel Fetchinson wrote:
>>> > I am not, however, an in depth language nutter, so would
>>> > appreciate any of our more learned readers comments.
>
> Maybe I'm missing the obvious here, but what does Cobra have to do
> with Microsoft?
> (Apart from being .NET oriented.) It seems it's an open so
-On [20080208 15:16], [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
>What is an elegant way of getting the local time (considering DST -
>daylight saving time) with that data?
Perhaps using pytz might be the easiest way: http://pytz.sourceforge.net/
--
Jeroen Ruigrok van der Werven / a
On Feb 8, 7:04 am, Larry Bates <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I'm developing a program that runs using an asyncore loop. Right now
> > I can adequately terminate it using Control-C, but as things get
> > refined I need a better way to stop it. I've developed another
> >
Steve,
I have discontinued the use of ?? a long time ago. Why is this
still a problem?
David
-Original Message-
From: Steve Holden [mailto:[EMAIL PROTECTED]
Sent: Friday, February 08, 2008 10:52 AM
To: python-list@python.org
Subject: Re: Dear David
Dan Upton wrote:
> On
'in' has a lower operator precedence than '=='
('t' in sample) == True
would fix the operator precedence.
On Feb 8, 2008 11:09 AM, c james <[EMAIL PROTECTED]> wrote:
> Try this
>
> >>> sample = {'t':True, 'f':False}
> >>> 't' in sample
> True
> >>> type('t' in sample)
>
> >>> 't' in sample ==
[EMAIL PROTECTED] wrote:
> I need to search list a for the sequence of list b
def list_contains(a, b):
return any(a[i:i+len(b)] == b for i in range(len(a) - len(b) + 1))
list_contains(range(1, 7), [2, 3, 4])
--
Paul Hankin
--
http://mail.python.org/mailman/listinfo/python-list
On Friday 08 February 2008 03:36, waltbrad
wrote:
> Working through the Mark Lutz book
> Programming Python 3rd Edition.
>
> A couple of modules in the "Preview"
> chapter give me errors. Both on a
> shelve.open call:
>
> Pretty simple code, (2nd example):
from;
jim-on-linux
http://[EMAIL PROTEC
> I have discontinued the use of ?? a long time ago. Why is this
> still a problem?
Welcome to bewildering yet joyful world of usenet!
It seems you are already having quite some fun!
--
http://mail.python.org/mailman/listinfo/python-list
Is there a best practice on how to override __new__?
I have a base class, RDFObject, which is instantiated using a unique
identifier (a URI in this case). If an object with a given identifier
already exists, I want to return the existing object, otherwise, I
want to create a new object and add thi
Hallo,
I need to search list a for the sequence of list b
First I went
>>> a=[1,2,34,4,5,6]
>>> b=[2,3,4]
>>> a in b
False
So
''.join([ v.__str__() for v in b ]) in ''.join([ v.__str__() for v in a ])
>>> s=SomeObject()
>>> a=[1,2,3,[s,3,[4,s,9]],s,4]
>>> b=[3,[s,3,[4,s,9]],s,4]
>>> ''.join([
Dan Upton wrote:
> On Feb 7, 2008 8:59 PM, ajaksu <[EMAIL PROTECTED]> wrote:
>> On Feb 7, 10:05 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote:
>>> I do not understand why people such as yourself cannot construct
>>> anything but insults and complaints.
>> I can help with that. People asked pol
On Feb 8, 3:38 am, [EMAIL PROTECTED] wrote:
> Can't you just make a subclass of Boolean and add methods to the true/
> false, or am i running up a tree with a cat?
I'm not sure what point you were trying to make, but no you can't
subclass bool in Python as it is now; certainly it wouldn't be
possi
On 2008-02-08, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> A Parsec is a fixed value (which, admittedly, presumes the culture
> developed a 360degree circle broken into degrees => minutes =>
> seconds... or, at least, some units compatible with the concept of an
> "arc second", like 400 g
On 08/02/2008, Steve Holden <[EMAIL PROTECTED]> wrote:
> Daniel Fetchinson wrote:
> >>> > I am not, however, an in depth language nutter, so would
> >>> > appreciate any of our more learned readers comments.
> >
> > Maybe I'm missing the obvious here, but what does Cobra have to do
> > with
Hi all. I'm just starting to pick up python. I wanted to play with nested
lists so first I wrote a little bit of code to create arbitrarily nested
lists (grow). Then I wrote a breadth first search. I'm putting this small
snippet up asking for criticism. Was there a more elegant way to do what I'm
In article <[EMAIL PROTECTED]>,
Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2008-02-08, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
>
> > A Parsec is a fixed value (which, admittedly, presumes the culture
> > developed a 360degree circle broken into degrees => minutes =>
> > seconds... or
On Friday 08 February 2008 03:36, waltbrad
wrote:
> Working through the Mark Lutz book
> Programming Python 3rd Edition.
>
> A couple of modules in the "Preview"
> chapter give me errors. Both on a
> shelve.open call:
>
> Pretty simple code, (2nd example):
> =code begin=
> import shelve
>
From: Dan Fabrizio [mailto:[EMAIL PROTECTED]
Sent: Friday, February 08, 2008 2:56 PM
To: Blubaugh, David A.
Subject: Re: MyHDL project !
David,
No problem with the mailing list, others might have some experience that
could be useful. Let me know how yo
[EMAIL PROTECTED] wrote:
> I realize in the new style, getattr and setattr are supposed to
> reference something in a base class, but here is what I'm trying to
> do:
>
> class tryit:
> def __init__(self, a, b):
> self.__dict__["a"] = a
> self.__dict__["b"] = b
> def __dir_
On Feb 8, 7:20 pm, "Zack" <[EMAIL PROTECTED]> wrote:
> Hi all. I'm just starting to pick up python. I wanted to play with nested
> lists so first I wrote a little bit of code to create arbitrarily nested
> lists (grow). Then I wrote a breadth first search. I'm putting this small
> snippet up askin
En Fri, 08 Feb 2008 13:58:53 -0200, Steve Holden <[EMAIL PROTECTED]>
escribió:
>> "Mariano Suárez-Alvarez" <[EMAIL PROTECTED]> writes:
>>> On Feb 7, 3:38 pm, [EMAIL PROTECTED] wrote:
[disclaimer dozens of lines long]
>>> Is this absurd signature really necessary?
> That particular trailing
On Feb 8, 5:06 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I need to search list a for the sequence of list b
>
> def list_contains(a, b):
> return any(a[i:i+len(b)] == b for i in range(len(a) - len(b) + 1))
>
> list_contains(range(1, 7), [2, 3, 4])
>
> --
> Paul H
On Feb 8, 3:40 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> On Feb 8, 7:20 pm, "Zack" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi all. I'm just starting to pick up python. I wanted to play with nested
> > lists so first I wrote a little bit of code to create arbitrarily nested
> > lists (grow). T
On Feb 8, 5:09 pm, c james <[EMAIL PROTECTED]> wrote:
> Try this
>
> >>> sample = {'t':True, 'f':False}
> >>> 't' in sample
> True
> >>> type('t' in sample)
>
> >>> 't' in sample == True
>
> False
>
> Why is this? Now try>>> bool('t' in sample) == True
>
> True
>
> Can someone explain what is goi
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Grant Edwards
> Sent: Friday, February 08, 2008 12:46 PM
> To: python-list@python.org
> Subject: Re: Why not a Python compiler?
>
> On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
En Fri, 08 Feb 2008 13:24:19 -0200, <[EMAIL PROTECTED]>
escribió:
>
> Matt.
> (would it help if I put lots of blank lines after this, so the disclaimer
> is out-of-sight/out-of-mind?)
> --
> ie, from here on?
No, what would help is a line containing *exactly*
(dash)(dash)(space)(newline)
That
[EMAIL PROTECTED] wrote:
> Hallo,
>
>
> I need to search list a for the sequence of list b
>
I guess most pythonic would be sth like this:
[code]
def naive_seq_match(sequence, pattern):
"""Serches for pattern in sequence. If pattern is found
returns match start index, else returns No
Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>kettle <[EMAIL PROTECTED]> writes:
>> # pack $length as a 32-bit network-independent long
>> my $len = pack('N', $length);
>[...]
>> the sticking point seems to be the $len variable.
>Use len = struct.pack('!L', length) in Python. See
>http://docs.python.
On Feb 8, 1:30 am, "jack trades" <[EMAIL PROTECTED]> wrote:
> "Mike Hjorleifsson" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> > on windows you can put this in HKEY_Local_Machine\Software\Microsoft
> > \Windows\Current Version\Run and it will run at logon (or fast user
> > sw
On Fri, 08 Feb 2008 08:25:56 +0100, Torsten Bronger wrote:
> Hallöchen!
>
> Reedick, Andrew writes:
>
>>> -Original Message-
>>> From: [EMAIL PROTECTED] [mailto:python-
>>> [EMAIL PROTECTED] On Behalf Of Torsten Bronger
>>> Sent: Thursday, February 07, 2008 3:32 PM To: python-list@python
Hi,
Can anyone help me in executing python scripts on remote computer? Both are
windows machines.
Thanks,
Praveena.
--
http://mail.python.org/mailman/listinfo/python-list
On 8 Feb, 08:16, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
> [snip more interesting considerations about compiling python]
>
> Please get back on topic. This discussion is about parsecs and
> wookies now.
Yes, it's like the lower-value parts of Wikipedia have spilled out
onto Usenet. ;-)
But
Hi, I've been reading up on the SCons build tool. It's intended to
work by the end-user calling 'scons' on a buildscript. However, I'd
like to use it from my own python project as an imported module, and
have my already-written classes use the Scons objects to take actions
without an external scrip
Arnaud Delobelle wrote:
(...)
>
> from itertools import chain
>
> def overlaps(lst):
> bounds = chain(*(((x[1],i), (x[2], i)) for i,x in enumerate(lst)))
imho, this is a uselessly painful equivalent of
bounds = ((x[k],i) for i,x in enumerate(lst) for k in (1,2))
Cheers, BB
--
http:
On Feb 8, 1:48 pm, Boris Borcic <[EMAIL PROTECTED]> wrote:
> Arnaud Delobelle wrote:
>
> (...)
>
>
>
> > from itertools import chain
>
> > def overlaps(lst):
> > bounds = chain(*(((x[1],i), (x[2], i)) for i,x in enumerate(lst)))
>
> imho, this is a uselessly painful equivalent of
>
> bou
> Is thate really all of the error? It hints on a missing include, which
> will be mentioned earlier.
>
> Diez
platform: linux2
REQUIRED DEPENDENCIES
numpy: 1.0.3.1
freetype2: found, but unknown version (no pkg-config)
OPTIONAL BACKEND DEPENDENCIES
On Feb 8, 5:20 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of c james
> > Sent: Friday, February 08, 2008 12:10 PM
> > To: [EMAIL PROTECTED]
> > Subject: keyword 'in' not returning a bool
Grant Edwards wrote:
> On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
>>> the compiler could do little else except translate it to something
>>> like:
>>>
>>> (python:add a b)
>> [snip more interesting considerations about compiling python]
>>
>> Please get back on topic. This discu
2008/2/8, Freek Dijkstra <[EMAIL PROTECTED]>:
> Is there a best practice on how to override __new__?
>
> I have a base class, RDFObject, which is instantiated using a unique
> identifier (a URI in this case). If an object with a given identifier
> already exists, I want to return the existing ob
Boris Borcic wrote:
> Arnaud Delobelle wrote:
> (...)
>>
>> from itertools import chain
>>
>> def overlaps(lst):
>> bounds = chain(*(((x[1],i), (x[2], i)) for i,x in enumerate(lst)))
>
> imho, this is a uselessly painful equivalent of
>
> bounds = ((x[k],i) for i,x in enumerate(lst) for
On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>> the compiler could do little else except translate it to something
>> like:
>>
>> (python:add a b)
> [snip more interesting considerations about compiling python]
>
> Please get back on topic. This discussion is about parsecs and
> woo
On Feb 8, 4:44 pm, Freek Dijkstra <[EMAIL PROTECTED]> wrote:
> Is there a best practice on how to override __new__?
>
> I have a base class, RDFObject, which is instantiated using a unique
> identifier (a URI in this case). If an object with a given identifier
> already exists, I want to return the
Please pardon the PSA:
The New York City Python Users Meetup Group is planning on having our
February meeting on
February 12th, from 6:30pm - 8:00pm. For more information, please see:
http://python.meetup.com/172/calendar/7082384/
Anyone in the NYC area interested in using Python, learning m
En Fri, 08 Feb 2008 06:36:53 -0200, waltbrad <[EMAIL PROTECTED]>
escribió:
> Working through the Mark Lutz book Programming Python 3rd Edition.
>
> A couple of modules in the "Preview" chapter give me errors. Both on a
> shelve.open call:
>
> Pretty simple code, (2nd example):
> =code begin=
In article <[EMAIL PROTECTED]>,
c james <[EMAIL PROTECTED]> wrote:
sample = {'t':True, 'f':False}
't' in sample == True
>False
>
>Why is this?
http://docs.python.org/lib/comparisons.html
"Comparisons can be chained arbitrarily; for example, x < y <= z is
equivalent to x < y and y <= z,
On 2008-02-08, Blubaugh, David A. <[EMAIL PROTECTED]> wrote:
> I have discontinued the use of ?? a long time ago. Why
> is this still a problem?
You're still top posting and not trimming quotes. That annoys
a lot of people.
--
Grant Edwards grante Yow! MERYL
On 2008-02-08, Dan Upton <[EMAIL PROTECTED]> wrote:
> I don't know, I'm inclined to agree with him. Repeatedly
> replying to bash his use of grammar or punctuation is
> unnecessary. Replying to the list to mock repeatedly is
> doubly unnecessary.
While c.l.p is exceptionally polite and tolerant
On Fri, 08 Feb 2008 16:39:55 +, Matthew_WARREN wrote:
> Hallo,
>
>
> I need to search list a for the sequence of list b
>
> First I went
a=[1,2,34,4,5,6]
b=[2,3,4]
a in b
> False
You have the order of a and b mixed up there. As you have it, you are
searching b for a.
>
Zack wrote:
> Hi all. I'm just starting to pick up python. I wanted to play with nested
> lists so first I wrote a little bit of code to create arbitrarily nested
> lists (grow). Then I wrote a breadth first search. I'm putting this small
> snippet up asking for criticism. Was there a more elegan
[EMAIL PROTECTED] wrote:
> On Feb 8, 7:04 am, Larry Bates <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>>> I'm developing a program that runs using an asyncore loop. Right now
>>> I can adequately terminate it using Control-C, but as things get
>>> refined I need a better way to stop it.
On Feb 8, 4:03 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
> When signal is caught handle_shutdown_signal is called. At that point
> SHUTDOWN_PERFORMED will ALWAYS be False. Normally all you do in this function
> is to set SHUTDOWN_PERFORMED to True and have a test somewhere in your main
> program
Grant Edwards wrote:
> On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
>>> the compiler could do little else except translate it to something
>>> like:
>>>
>>> (python:add a b)
>> [snip more interesting considerations about compiling python]
>>
>> Please get back on topic. This discu
Grant Edwards wrote:
> On 2008-02-08, Blubaugh, David A. <[EMAIL PROTECTED]> wrote:
>
>> I have discontinued the use of ?? a long time ago. Why
>> is this still a problem?
>
> You're still top posting and not trimming quotes. That annoys
> a lot of people.
>
It isn't a problem, I was mere
Carl Banks:
> I think booleans should be completely disjoint from all other types,
> as they are in Java. "and", "or", and "not" should accept only boolean
> operands and return only boolean results.
I'd like "or" and "and" (and "not") to return booleans only, to avoid
bugs and make their meanin
J Peyret wrote:
> - Same with using try/except KeyError instead of in cls.cache.
> Has_key might be better if you insist on look-before-you-leap, because
> 'in cls.cache' probably expends to uri in cls.cache.keys(), which can
> be rather bad for perfs if the cache is very big. i.e. dict lookups
>
I think the metaclass stuff is a bit too black magic for a pretty
simple requirement.
Txs in any case for showing me the __init__ issue, I wasn't aware of
it.
Here's a workaround - not exactly elegant in terms of OO, with the
isInitialized flag, but it works.
>>> class RDFObject(object):
...
I have type variable which may have been set to 'D' or 'E'
Now, which one of following statements are more efficient
if type =='D' or type == 'E':
or
if re.search("D|E", type):
Please let me know because the function is going to called 10s of millions
of times.
Thanks
Kilo
--
http://mail.pyt
On Sat, 09 Feb 2008 00:04:26 +, Matt Nordhoff wrote:
> At worst, in and has_key are "about the same".
Except that using has_key() means making an attribute lookup, which takes
time.
I'm kinda curious why you say they're "about the same" when your own
timing results contradict that. Here th
En Fri, 08 Feb 2008 22:04:26 -0200, Matt Nordhoff
<[EMAIL PROTECTED]> escribió:
> J Peyret wrote:
>> - Same with using try/except KeyError instead of in cls.cache.
>> Has_key might be better if you insist on look-before-you-leap, because
>> 'in cls.cache' probably expends to uri in cls.cache.key
Do you think it is relatively easy to write sort algorithms such as
the common Bubble sort in Python as compared to other high level
programming langauges
--
http://mail.python.org/mailman/listinfo/python-list
LHB <[EMAIL PROTECTED]> writes:
> Marc 'BlackJack' Rintsch a écrit :
> > `__builtins__` is an implementation detail, and `__builtin__` is a name
> > of a module you can import. You should not use `__builtins__` but import
> > `__builtin__` and inspect that instead of `__builtins__`.
> Ok. Should
ki lo wrote:
> I have type variable which may have been set to 'D' or 'E'
>
> Now, which one of following statements are more efficient
>
> if type =='D' or type == 'E':
>
> or
>
> if re.search("D|E", type):
>
> Please let me know because the function is going to called 10s of
> millions of t
On Fri, 08 Feb 2008 17:45:36 +, Grant Edwards wrote:
> On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
>> Please get back on topic. This discussion is about parsecs and
>> wookies now.
>
> What's a "wookie" a unit of?
The degree of confusion among the jury when using the Chewb
Steven D'Aprano wrote:
> Except that using has_key() means making an attribute lookup, which takes
> time.
I was going to say that, but doesn't 'in' require an attribute lookup of
some sort too, of __contains__ or whatever? has_key is probably now just
a wrapper around that, so it would be one mo
En Fri, 08 Feb 2008 22:45:06 -0200, ki lo <[EMAIL PROTECTED]> escribió:
> I have type variable which may have been set to 'D' or 'E'
>
> Now, which one of following statements are more efficient
>
> if type =='D' or type == 'E':
>
> or
>
> if re.search("D|E", type):
>
> Please let me know because
1 - 100 of 125 matches
Mail list logo