Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python os path join list

# The problem is, os.path.join doesn't take a list as argument, it has to be separate arguments.
# This is where *, the 'splat' operator comes into play...
>>> s = "c:/,home,foo,bar,some.txt".split(",")
>>> os.path.join(*s)
'c:/homefooarsome.txt'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #os #path #join #list
ADD COMMENT
Topic
Name
7+8 =