4

I'm translating Linux commands to a python script. How would I perform the Linux command 'ln -s'

CMD:

    ln -s /users/me/link_file hello 

I want to link 'hello' to 'link_file' in python

Thanks!

Xandy
  • 155
  • 2
  • 2
  • 9

1 Answers1

15

os.symlink() is the provided function for creating symlinks. They are created as such:

import os
os.symlink(src,dst)

Where src and dst are the paths.

See the documentation here for more info.

Hal Jarrett
  • 825
  • 9
  • 19