how to open tor browser in mac using python?

184 Views Asked by At

I'm trying to open tor browser using mac os in python, but always getting permission denied error, we checked the folder permission and it is there as read and write only

def open_tor():
       # careful about the / when you it's usually \
       subprocess.Popen(["/Applications/Tor Browser.app"],
                     stdout=subprocess.PIPE,
                     stderr=subprocess.STDOUT)
       time.sleep(10)  # to give plenty of time for Tor to load

Error:

self._execute_child(args, executable, preexec_fn, close_fds,
File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", 
line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/Applications/Tor Browser.app'

I'm getting permission denied error

1

There are 1 best solutions below

0
On

PermissionError: [Errno 13] Permission denied

  1. Please make sure the path you call open with is a file.
  2. Run vscode as Administrator.