Jun-14-2021, 08:45 PM
I'm trying to remove/clean a bunch of directories using 'glob.glob'
I do not want to do 10 'try/except' for each directory.
I thought I can make a list of directories
I tried
thank you.
I do not want to do 10 'try/except' for each directory.
I thought I can make a list of directories
prod_tod_to_Rem = glob.glob("C:/0001/**/*.txt", recursive=True) dev_tod_to_Rem =glob.glob("C:/04/**/*.txt",recursive=True) rm_lst = [prod_tod_to_Rem,dev_tod_to_Rem]and will pass them to the try/except one by one.
I tried
rm_lst = [*prod_tod_to_Rem, *dev_tod_to_Rem]it does the same thing like the
rm_lst = [prod_tod_to_Rem,dev_tod_to_Rem] tor = [str(i) for i in rm_lst] print(tor)I might be confused and do not understand your suggestion...
thank you.