I have directory factory
under which I have app dir app_1_2_3_4
. I want to create a symlink under factory
for app -> app_1_2_3_4
from /home/user/
dir without using os.chdir()
, just like this. Don't want full path in link.
user@ubuntu % ls -l factory/
total 0
lrwxrwxrwx@ 1 user user 13 Mar 15 04:27 app -> app_1_2_3_4
drwxrwxr-x@ 18 user user 576 Mar 18 17:09 app_1_2_3_4
I tried this in python
import os
app_dir_path = '/home/user/factory' + '/' + 'app'
app_dir_ver_path = '/home/user/factory' + '/../' + 'app' + '_{}_{}_{}_{}'.format(major, minor, bugfix, build)
os.symlink(app_dir_ver_path, app_dir_path)
But this one creating symlink with full path
user@ubuntu % ls -l factory/
total 0
lrwxrwxrwx@ 1 user user 13 Mar 15 04:27 app -> /home/user/factory/app_1_2_3_4
drwxrwxr-x@ 18 user user 576 Mar 18 17:09 app_1_2_3_4
What I am missing here?