os.path - merge paths with python, from /a/b/c + c/d to /a/b/c/d -


in python, os.path.join, can join directories paths

import os os.path.join('/usr','opt', 'bin') '/usr/opt/bin' 

how can merge 2 path ?

from

/a/b/c + c/d 

get

/a/b/c/d 

if sure paths of form give example for,

os.path.join(os.path.split(p1)[0], p2) 

would it.


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -