How do you do an os.path.join with an array in python?
How do you do an os.path.join with an array in python? Basically, I want开发者_StackOverflow to be able to run that command with an array as an argument. Any help is highly appreciated.
By array I assume you mean list.
os.path.join(*parts)
The * takes a list (or similar object) and expands it into parameters. Be careful using it, in many situations it will make your code harder to read. But here is makes sense.
精彩评论