0

I use python on macos. I want to create a symlink using os.symlink() , it works on regular directory but i want to link or mount folders into my /Volumes/ which need password. In terminal i have to do symlink using 'sudo' command.

How to do it in python ? What is the best mechanism to pass the password when i call os.symlink() ?

andio
  • 1,574
  • 9
  • 26
  • 45
  • 1
    It’s not password protected, the password you typed is to grant the root user access. So you only need to grant the root access to your python script: run it as sudo. – Kassian Sun Aug 09 '21 at 15:38
  • 1
    If you want to elevate your python process, you can use: https://pypi.org/project/elevate/ – KetZoomer Aug 09 '21 at 16:00
  • @KassianSun i'm using python inside other app. In this case i use Foundry Nuke (vfx app) so how can i can run it as sudo ? actually i don't mind to type password when the script is running and ask for grant , as long as i don't put the pass inside the script. – andio Aug 09 '21 at 17:11

0 Answers0