1

`os.symlink` vs `ln -s`

view story
linux-howto

http://stackoverflow.com – I need to create a symlink for every item of dir1 (file or directory) inside dir2. dir2 already exists and is not a symlink. In linux I can easily achieve this by: ln -s /home/guest/dir1/* /home/guest/dir2/ But in python using os.symlink I get an error: >>> os.symlink('/home/guest/dir1/*', '/home/guest/dir2/') Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: [Errno 17] File exist I know I can use subprocess and run ln command. I don't want that solution. I'm also aware that workarounds using os.walk or glob.glob are possible, but I (HowTos)