开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜