[Python-ideas] need python automation code convert MDB files into csv files.

MRAB python at mrabarnett.plus.com
Tue Feb 5 08:02:17 EST 2019


On 2019-02-05 11:42, Rhodri James wrote:
> On 05/02/2019 00:10, vinoth A N wrote:
[snip]
>> extension = 'mdb'
>> result = [i for i in glob.glob('*.{}'.format(extension))]
> 
> Not a bug, but you are making unnecessary work for yourself here.
> 'extension' is only ever the string "mdb", so why go to all the trouble
> of formatting it into a string when you could just write:
> 
>     result = [i for i in glob.glob('*.mdb')]
> 
You can do better than that. glob returns a list!

[snip]


More information about the Python-ideas mailing list