need python automation code convert MDB files into csv files.

Hello Friends, I am in process of writing python automation code through which I can read the MDB file which contains several tables which need to convert them in multiple CSV file or xlsx file. ## package required import pandas as pd import numpy as np import os import glob from functools import reduce # to know how many csv file and name csv file in current floder os.chdir('C:\\Users\\anvinoth\\Desktop\\BODOPD\\DXA_C2') # code to change working directory extension = 'mdb' result = [i for i in glob.glob('*.{}'.format(extension))] print(result) ['FB4-DXA-C2-BSL.mdb'] import pandas_access as mdb # Listing the tables. for tbl in mdb.list_tables('FB4-DXA-C2-BSL.mdb'): print(tbl) # Read a small table. df =mdb.read_table('FB4-DXA-C2-BSL.mdb', "Patient") i am getting this error WinError 2] The system cannot find the file specified I am searching in google but I did not find a relevant answer could anyone in the group help me out with correct code to convert the MDB file into CSV file? thanks vinoth

On 05/02/2019 00:10, vinoth A N wrote:
Hello Friends,
Hello there! This is actually a mailing list/newsgroup for discussing ideas for extending and developing the Python language, not for dealing with people's programming problems. I've made some comments here, but in the future could you use python-list@python.org (the mailing list) or comp.lang.python (the newsgroup), please.
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')]
Is this a different file? If so, have you os.chdir()ed back to the working directory? If not, it's considered good practice to put all your 'import' statements at the top of the file.
I'm sure Python printed out a whole lot more information than that, including the line of code that caused the problem. It would help if you gave us the entire traceback (from the line beginning "Traceback"). Please copy and paste the text; don't try to transcribe it or take a screen shot! -- Rhodri James *-* Kynesim Ltd

On 05/02/2019 00:10, vinoth A N wrote:
Hello Friends,
Hello there! This is actually a mailing list/newsgroup for discussing ideas for extending and developing the Python language, not for dealing with people's programming problems. I've made some comments here, but in the future could you use python-list@python.org (the mailing list) or comp.lang.python (the newsgroup), please.
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')]
Is this a different file? If so, have you os.chdir()ed back to the working directory? If not, it's considered good practice to put all your 'import' statements at the top of the file.
I'm sure Python printed out a whole lot more information than that, including the line of code that caused the problem. It would help if you gave us the entire traceback (from the line beginning "Traceback"). Please copy and paste the text; don't try to transcribe it or take a screen shot! -- Rhodri James *-* Kynesim Ltd
participants (3)
-
MRAB
-
Rhodri James
-
vinoth A N