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!
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!
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.
© 2022 - 2024 — McMap. All rights reserved.
subprocess
module. If you want to create a symlink in the same way the Linux command does, see theos
orpathlib
module. – Montcalm