Pythonic use of CSV module to skip headers?

2004-12-02 Thread Ramon Felciano
Hi -- I'm using the csv module to parse a tab-delimited file and wondered whether there was a more elegant way to skip an possible header line. I'm doing line = 0 reader = csv.reader(file(filename)) for row in reader: if (ignoreFirstLine & line == 0):

Re: Pythonic list to bitflag mapping

2004-12-02 Thread Ramon Felciano
> Or can be used directly as an integer index to get a character > > >>> ['01'[x in a] for x in xrange(10)] > ['0', '0', '0', '1', '1', '0', '1', '0', '0', '0'] > Very cool -- this does the trick nicely and seems quite extensible, now that I get the basic idiom. Belated thanks for the quick re