[Python-ideas] need python automation code convert MDB files into csv files.
Rhodri James
rhodri at kynesim.co.uk
Tue Feb 5 08:13:55 EST 2019
On 05/02/2019 13:02, MRAB wrote:
> 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!
Duh! Good point.
--
Rhodri James *-* Kynesim Ltd
More information about the Python-ideas
mailing list