On Jul 13, 6:34 pm, Carsten Haese <[EMAIL PROTECTED]> wrote:
> def recursive_powerset(s):
> if not s: yield set()
> for x in s:
> s2 = s - set([x])
> for subset in recursive_powerset(s2):
> yield subset
> yield subset.union(set([x]))
>
Your recursive_
On Jul 13, 5:05 am, [EMAIL PROTECTED] wrote:
> In Idle when I do print 'รก'.isalpha() I get True. When I make and
> execute a script file with the same code I get False.
>
> Why do I have diferent answers ?
Non-ASCII characters in ordinary (8-bit) strings have all kinds of
strangeness. First, the a
On Jul 8, 12:21 am, David <[EMAIL PROTECTED]> wrote:
> Hi,
>
> In matlab, I'd calculate the time for a script named test.m to run
> with:
>
> >> tic, run, toc
>
> Is there some way to do this in python on a mac os x from the terminal
> window? Or whatever?
The timeit module may be of use:
http://d
On Jul 6, 2:21 am, Jyotirmoy Bhattacharya <[EMAIL PROTECTED]>
wrote:
> On Jul 6, 12:31 am, [EMAIL PROTECTED] wrote:
>
>
>
> > I had nothing better to do, so I thought I would make a database that
> > contained the songs played on the internet radio station I list
On Jul 6, 12:31 am, [EMAIL PROTECTED] wrote:
> I had nothing better to do, so I thought I would make a database that
> contained the songs played on the internet radio station I listen to
> (hardradio.com) so I could see how many differents songs/artists they
> played.
> So I end up with a the num
On Jun 28, 10:53 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Jyotirmoy Bhattacharya <[EMAIL PROTECTED]> wrote:
> > print [(m,n) for m in range(5) for n in multab(m) if m>2]
> > I was wondering if there is some way to write the if-clause so that it
> > is 'hoi
I'm a newcomer to Python. I have just discovered nested list
comprehensions and I need help to understand how the if-clause
interacts with the multiple for-clauses. I have this small program:
def multab(n):
print 'multab',n
return [n*i for i in range(5)]
print [(m,n) for m in range(5) for