Reputation: 357
I have found multiple examples about similar questions in SO where they want to flatten a list made of multiple lists e.g [[0,1][2,3][3,4]] into one list. But in my case I just want to unpack one item.
Note I am using the " * " operator that would normally work to expand lists into function arguments in my following example. But, What could I actually use instead the " * " that would unpack my files in this scenario ?
unpack = ["file_1.txt", "file_2.txt", "file_3.txt"]
if unpack:
subprocess.call(["mv", *unpack, "/destination_path"])
Upvotes: 1
Views: 184