In [3]: pwd
Out[3]: u'/Users/aarcher/Desktop/scripts'
In [5]: subprocess.call(['mkdir', '-p', os.path.expanduser('~/file/path/name')])
Out[5]: 0
I verified in another terminal that it had created /Users/aarcher/file/path/name successfully, but unable to change to that directory, even when it returns 0:
In [7]: subprocess.call(['cd', os.path.expanduser('~/file/path/name')], shell=True)
Out[7]: 0
In [8]: pwd
Out[8]: u'/Users/aarcher/Desktop/scripts'
I am in unix box