开发者

How do you do an os.path.join with an array in python?

开发者 https://www.devze.com 2023-01-27 07:34 出处:网络
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 assu

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

精彩评论

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