I have a problem with trying to pass a list into a subprocess call command. I am trying to call the windows robocopy function, passing a list of file types that it should filter by.
filter_list = ['*.txt', '*.dat']
call(["robocopy", src, dst, filter_list, "/e"])
So passing the list itself does not work the output from robocopy showed that it was trying to find the file type ".txt.dat" as if the whole list were a single file type.
I then tried the following
call(["robocopy", src, dst, ','.join(filter_list), "/e"])
However that gave the same output as my first attempt. Does anyone know how to pass in a list and have it properly divided? Any help is much appriciated!