I am trying to use the following line of code to get all the pathnames of files in a given directory:
trainDB = [os.path.abspath(x) for x in os.listdir("C:/Users/sean/Documents/uni/ANLP/Data/Train/DrugBank")]
But the ouput is like so:
['C:\\Users\\sean\\Documents\\uni\\ANLP\\Data\\19-norandrostenedione_ddi.xml', ...]
Whereas I want/expect the resultant path to be:
`'C:\\Users\\sean\\Documents\\uni\\ANLP\\Data\\Train\\DrugBank\\19-norandrostenedione_ddi.xml'
I dont understand why the Train/DrugBank diretories are not in the path, if its any use I am runnig these commands from the ANLP
directory which is one above Data